home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / 335_04.zip / ASZ80.Y next >
Text File  |  1993-04-13  |  57KB  |  2,353 lines

  1. %{
  2.  
  3. /*
  4. HEADER:     ;
  5. TITLE:         Frankenstein Cross Assemblers;
  6. VERSION:     2.0;
  7. DESCRIPTION: "    Reconfigurable Cross-assembler producing Intel (TM)
  8.         Hex format object records.  ";
  9. KEYWORDS:     cross-assemblers, 1805, 2650, 6301, 6502, 6805, 6809, 
  10.         6811, tms7000, 8048, 8051, 8096, z8, z80;
  11. SYSTEM:     UNIX, MS-Dos ;
  12. FILENAME:     asz80.y;
  13. WARNINGS:     "This software is in the public domain.  
  14.         Any prior copyright claims are relinquished.  
  15.  
  16.         This software is distributed with no warranty whatever.  
  17.         The author takes no responsibility for the consequences 
  18.         of its use.
  19.  
  20.         Yacc (or Bison) required to compile."  ;
  21. SEE-ALSO:     asz80.doc,frasmain.c;    
  22. AUTHORS:     Mark Zenier;
  23. COMPILERS:     Microport Sys V/AT, ATT Yacc, Turbo C V1.5, Bison (CUG disk 285)
  24.         (previous versions Xenix, Unisoft 68000 Version 7, Sun 3);
  25. */
  26. /*   framework crossassembler for z80 + and minus */
  27. /* November 17, 1990 */
  28.  
  29. /*
  30.     description    frame work parser description for framework cross
  31.             assemblers
  32.     history        February 2, 1988
  33.             September 11, 1990 - merge table definition
  34.             September 12, 1990 - short file names
  35.             September 14, 1990 - short variable names
  36.             September 17, 1990 - use yylex as external
  37. */
  38. #include <stdio.h>
  39. #include "frasmdat.h"
  40. #include "fragcon.h"
  41.  
  42. #define yylex lexintercept
  43.  
  44. /*
  45.     file        critz80.h
  46.     author        Mark Zenier
  47.     description    selection critera and syntax type defines for
  48.             the z80 frasm (framework cross assembler)
  49.     usage        Unix
  50.     history        January 22, 1988
  51. */
  52.  
  53. /* xxxx.0000.0000.0000  cpu mask selection for all instructions */
  54.  
  55. #define    CPUMASK        0xf000
  56.  
  57. #define    CPU8080        0x1000
  58. #define    CPU8085        0x3000
  59. #define    CPUZ80        0x7000
  60. #define    CPU64180    0xf000
  61.  
  62. #define    TS8080PLUS    0x1000
  63. #define    TS8085PLUS    0x2000
  64. #define    TSZ80PLUS    0x4000
  65. #define    TS64180        0x8000
  66.  
  67. /* 0000.0000.0xxx.xxxx  double register select bits for B02, CC01, LD02, LD03,
  68.             LD05, LD06, LD07, LD08, LD09, LD10, LD12, N03, N04, N05,
  69.             N07, N11 */
  70. #define DRMASK 0x7f
  71. #define    DRIX    1
  72. #define    DRIY    2
  73. #define    DRSP    4
  74. #define    DRHL    8
  75. #define    DRDE    0x10
  76. #define    DRBC    0x20
  77. #define    DRAF    0x40
  78.  
  79. /* 0000.0xxx.x000.0000  destination select bits */
  80. #define    DRDESTMASK    0x780
  81. #define    DRDESTSP    0x80
  82. #define DRDESTHL    0x100
  83. #define DRDESTIX    0x200
  84. #define DRDESTIY    0x300
  85.  
  86. /* 0000.x000.0000.0000  register is accum for LD02, LD10 */
  87.  
  88. #define REGISA    0x800
  89.  
  90. /* register field values for instructions */
  91.  
  92. #define    VALREGA    7
  93. #define    VALREGB    0
  94. #define    VALREGC    1
  95. #define    VALREGD    2
  96. #define    VALREGE    3
  97. #define    VALREGH    4
  98. #define    VALREGL    5
  99.  
  100. #define ST_B01 0x1
  101. #define ST_B02 0x2
  102. #define ST_B03 0x4
  103. /* 0000.0000.xxxx.xxxx  condition select */
  104. #define CCSELMASK    0x00ff
  105. #define CCSELNZ    0x0001
  106. #define CCSELZ    0x0002
  107. #define CCSELNC    0x0004
  108. #define CCSELC    0x0008
  109. #define CCSELPO    0x0010
  110. #define CCSELPE    0x0020
  111. #define CCSELP    0x0040
  112. #define CCSELM    0x0080
  113. #define ST_CC01 0x1
  114. #define ST_CC02 0x2
  115. #define ST_CC03 0x4
  116. #define ST_CC04 0x8
  117. #define ST_CC05 0x10
  118. #define ST_EX01 0x1
  119. #define EXMASK    0xf
  120. /*    0000.0000.0000.00xx   */
  121. #define EX2AF        1
  122. #define EX2HL        2
  123. /*    0000.0000.0000.xx00   */
  124. #define EX1AF        4
  125. #define EX1DE        8
  126. #define ST_EX02 0x2
  127. #define ST_IM01 0x1
  128. /* 0000.0000.0000.0xxx   interrupt mode select bits */
  129. #define    INTSETMASK    7
  130. #define INTSETMODE0    1
  131. #define INTSETMODE1    2
  132. #define INTSETMODE2    4
  133. #define ST_IO01 0x1
  134. #define ST_IO02 0x2
  135. #define ST_IO03 0x4
  136. #define ST_IO04 0x8
  137. #define ST_LD01 0x1
  138. #define ST_LD02 0x2
  139. #define ST_LD03 0x4
  140. #define ST_LD04 0x8
  141. #define ST_LD05 0x10
  142. #define ST_LD06 0x20
  143. #define ST_LD07 0x40
  144. #define ST_LD08 0x80
  145. #define ST_LD09 0x100
  146. #define ST_LD10 0x200
  147. #define ST_LD11 0x400
  148. #define ST_LD12 0x800
  149. #define ST_LD13 0x1000
  150. #define ST_LD14 0x2000
  151. #define ST_LD15 0x4000
  152. /* 0000.0000.0000.00xx */
  153. #define SPECIALRMASK    3
  154. #define SPECIALIR    1
  155. #define SPECIALRR    2
  156. #define ST_LD16 0x8000
  157. #define ST_N01 0x1
  158. #define ST_N02 0x2
  159. #define ST_N04 0x4
  160. #define ST_N05 0x8
  161. #define ST_N06 0x10
  162. #define ST_N07 0x20
  163. #define ST_N08 0x40
  164. #define ST_N09 0x80
  165. #define ST_N10 0x100
  166. #define ST_N11 0x200
  167. #define ST_N12 0x400
  168. #define ST_R01 0x1
  169.     
  170.     unsigned int cpuselect = CPU64180;
  171.     static char    genbdef[] = "[1=];";
  172.     static char    genwdef[] = "[1=]y";
  173.     char ignosyn[] = "[Xinvalid syntax for instruction";
  174.     char ignosel[] = "[Xinvalid operands/illegal instruction for cpu";
  175.  
  176.     long    labelloc;
  177.     static int satsub;
  178.     int    ifstkpt = 0;
  179.     int    fraifskip = FALSE;
  180.  
  181.     struct symel * endsymbol = SYMNULL;
  182.  
  183. %}
  184. %union {
  185.     int    intv;
  186.     long     longv;
  187.     char    *strng;
  188.     struct symel *symb;
  189.     struct { int indsel, exp; } indexstruc;
  190. }
  191. %token <intv> SREGI
  192. %token <intv> SREGR
  193. %token <intv> REGA
  194. %token <intv> REGB
  195. %token <intv> REGC
  196. %token <intv> REGD
  197. %token <intv> REGE
  198. %token <intv> REGH
  199. %token <intv> REGL
  200. %token <intv> DREGAF
  201. %token <intv> DREGBC
  202. %token <intv> DREGDE
  203. %token <intv> DREGHL
  204. %token <intv> DREGIX
  205. %token <intv> DREGIY
  206. %token <intv> DREGSP
  207. %token <intv> CONDZ
  208. %token <intv> CONDNZ
  209. %token <intv> CONDNC
  210. %token <intv> CONDPE
  211. %token <intv> CONDPO
  212. %token <intv> CONDP
  213. %token <intv> CONDM
  214.  
  215. %type <intv> dreg condition reg8 specialr ixoriy topexpr
  216. %type <indexstruc> index
  217. %token <intv> KOC_BDEF
  218. %token <intv> KOC_ELSE
  219. %token <intv> KOC_END
  220. %token <intv> KOC_ENDI
  221. %token <intv> KOC_EQU
  222. %token <intv> KOC_IF
  223. %token <intv> KOC_INCLUDE
  224. %token <intv> KOC_ORG
  225. %token <intv> KOC_RESM
  226. %token <intv> KOC_SDEF
  227. %token <intv> KOC_SET
  228. %token <intv> KOC_WDEF
  229. %token <intv> KOC_CHSET
  230. %token <intv> KOC_CHDEF
  231. %token <intv> KOC_CHUSE
  232. %token <intv> KOC_CPU
  233. %token <intv> KOC_bit
  234. %token <intv> KOC_ccop
  235. %token <intv> KOC_exop
  236. %token <intv> KOC_intmode
  237. %token <intv> KOC_ioop
  238. %token <intv> KOC_ldop
  239. %token <intv> KOC_opcode
  240. %token <intv> KOC_restart
  241.  
  242. %token <longv> CONSTANT
  243. %token EOL
  244. %token KEOP_AND
  245. %token KEOP_DEFINED
  246. %token KEOP_EQ
  247. %token KEOP_GE
  248. %token KEOP_GT
  249. %token KEOP_HIGH
  250. %token KEOP_LE
  251. %token KEOP_LOW
  252. %token KEOP_LT
  253. %token KEOP_MOD
  254. %token KEOP_MUN
  255. %token KEOP_NE
  256. %token KEOP_NOT
  257. %token KEOP_OR
  258. %token KEOP_SHL
  259. %token KEOP_SHR
  260. %token KEOP_XOR
  261. %token KEOP_locctr
  262. %token <symb> LABEL
  263. %token <strng> STRING
  264. %token <symb> SYMBOL
  265.  
  266. %token KTK_invalid
  267.  
  268. %right    KEOP_HIGH KEOP_LOW
  269. %left    KEOP_OR KEOP_XOR
  270. %left    KEOP_AND
  271. %right    KEOP_NOT
  272. %nonassoc    KEOP_GT KEOP_GE KEOP_LE KEOP_LT KEOP_NE KEOP_EQ
  273. %left    '+' '-'
  274. %left    '*' '/' KEOP_MOD KEOP_SHL KEOP_SHR
  275. %right    KEOP_MUN
  276.  
  277.  
  278. %type <intv> expr exprlist stringlist
  279.  
  280. %start file
  281.  
  282. %%
  283.  
  284. file    :    file allline
  285.     |    allline
  286.     ;
  287.  
  288. allline    :     line EOL
  289.             {
  290.                 clrexpr();
  291.             }
  292.     |    EOL
  293.     |    error EOL
  294.             {
  295.                 clrexpr();
  296.                 yyerrok;
  297.             }
  298.     ;
  299.  
  300. line    :    LABEL KOC_END 
  301.             {
  302.                 endsymbol = $1;
  303.                 nextreadact = Nra_end;
  304.             }
  305.     |          KOC_END 
  306.             {
  307.                 nextreadact = Nra_end;
  308.             }
  309.     |    KOC_INCLUDE STRING
  310.             {
  311.         if(nextfstk >= FILESTKDPTH)
  312.         {
  313.             fraerror("include file nesting limit exceeded");
  314.         }
  315.         else
  316.         {
  317.             infilestk[nextfstk].fnm = savestring($2,strlen($2));
  318.             if( (infilestk[nextfstk].fpt = fopen($2,"r"))
  319.                 ==(FILE *)NULL )
  320.             {
  321.                 fraerror("cannot open include file");
  322.             }
  323.             else
  324.             {
  325.                 nextreadact = Nra_new;
  326.             }
  327.         }
  328.             }
  329.     |    LABEL KOC_EQU expr 
  330.             {
  331.                 if($1 -> seg == SSG_UNDEF)
  332.                 {
  333.                     pevalexpr(0, $3);
  334.                     if(evalr[0].seg == SSG_ABS)
  335.                     {
  336.                         $1 -> seg = SSG_EQU;
  337.                         $1 -> value = evalr[0].value;
  338.                         prtequvalue("C: 0x%lx\n",
  339.                             evalr[0].value);
  340.                     }
  341.                     else
  342.                     {
  343.                         fraerror(
  344.                     "noncomputable expression for EQU");
  345.                     }
  346.                 }
  347.                 else
  348.                 {
  349.                     fraerror(
  350.                 "cannot change symbol value with EQU");
  351.                 }
  352.             }
  353.     |    LABEL KOC_SET expr 
  354.             {
  355.                 if($1 -> seg == SSG_UNDEF
  356.                    || $1 -> seg == SSG_SET)
  357.                 {
  358.                     pevalexpr(0, $3);
  359.                     if(evalr[0].seg == SSG_ABS)
  360.                     {
  361.                         $1 -> seg = SSG_SET;
  362.                         $1 -> value = evalr[0].value;
  363.                         prtequvalue("C: 0x%lx\n",
  364.                             evalr[0].value);
  365.                     }
  366.                     else
  367.                     {
  368.                         fraerror(
  369.                     "noncomputable expression for SET");
  370.                     }
  371.                 }
  372.                 else
  373.                 {
  374.                     fraerror(
  375.                 "cannot change symbol value with SET");
  376.                 }
  377.             }
  378.     |    KOC_IF expr 
  379.             {
  380.         if((++ifstkpt) < IFSTKDEPTH)
  381.         {
  382.             pevalexpr(0, $2);
  383.             if(evalr[0].seg == SSG_ABS)
  384.             {
  385.                 if(evalr[0].value != 0)
  386.                 {
  387.                     elseifstk[ifstkpt] = If_Skip;
  388.                     endifstk[ifstkpt] = If_Active;
  389.                 }
  390.                 else
  391.                 {
  392.                     fraifskip = TRUE;
  393.                     elseifstk[ifstkpt] = If_Active;
  394.                     endifstk[ifstkpt] = If_Active;
  395.                 }
  396.             }
  397.             else
  398.             {
  399.                 fraifskip = TRUE;
  400.                 elseifstk[ifstkpt] = If_Active;
  401.                 endifstk[ifstkpt] = If_Active;
  402.             }
  403.         }
  404.         else
  405.         {
  406.             fraerror("IF stack overflow");
  407.         }
  408.             }
  409.                         
  410.     |    KOC_IF 
  411.             {
  412.         if(fraifskip) 
  413.         {
  414.             if((++ifstkpt) < IFSTKDEPTH)
  415.             {
  416.                     elseifstk[ifstkpt] = If_Skip;
  417.                     endifstk[ifstkpt] = If_Skip;
  418.             }
  419.             else
  420.             {
  421.                 fraerror("IF stack overflow");
  422.             }
  423.         }
  424.         else
  425.         {
  426.             yyerror("syntax error");
  427.             YYERROR;
  428.         }
  429.                 }
  430.                         
  431.     |    KOC_ELSE 
  432.             {
  433.                 switch(elseifstk[ifstkpt])
  434.                 {
  435.                 case If_Active:
  436.                     fraifskip = FALSE;
  437.                     break;
  438.                 
  439.                 case If_Skip:
  440.                     fraifskip = TRUE;
  441.                     break;
  442.                 
  443.                 case If_Err:
  444.                     fraerror("ELSE with no matching if");
  445.                     break;
  446.                 }
  447.             }
  448.  
  449.     |    KOC_ENDI 
  450.             {
  451.                 switch(endifstk[ifstkpt])
  452.                 {
  453.                 case If_Active:
  454.                     fraifskip = FALSE;
  455.                     ifstkpt--;
  456.                     break;
  457.                 
  458.                 case If_Skip:
  459.                     fraifskip = TRUE;
  460.                     ifstkpt--;
  461.                     break;
  462.                 
  463.                 case If_Err:
  464.                     fraerror("ENDI with no matching if");
  465.                     break;
  466.                 }
  467.             }
  468.     |    LABEL KOC_ORG expr 
  469.             {
  470.                 pevalexpr(0, $3);
  471.                 if(evalr[0].seg == SSG_ABS)
  472.                 {
  473.                     locctr = labelloc = evalr[0].value;
  474.                     if($1 -> seg == SSG_UNDEF)
  475.                     {
  476.                         $1 -> seg = SSG_ABS;
  477.                         $1 -> value = labelloc;
  478.                     }
  479.                     else
  480.                         fraerror(
  481.                         "multiple definition of label");
  482.                     prtequvalue("C: 0x%lx\n",
  483.                         evalr[0].value);
  484.                 }
  485.                 else
  486.                 {
  487.                     fraerror(
  488.                      "noncomputable expression for ORG");
  489.                 }
  490.             }
  491.     |          KOC_ORG expr 
  492.             {
  493.                 pevalexpr(0, $2);
  494.                 if(evalr[0].seg == SSG_ABS)
  495.                 {
  496.                     locctr = labelloc = evalr[0].value;
  497.                     prtequvalue("C: 0x%lx\n",
  498.                         evalr[0].value);
  499.                 }
  500.                 else
  501.                 {
  502.                     fraerror(
  503.                      "noncomputable expression for ORG");
  504.                 }
  505.             }
  506.     |    LABEL KOC_CHSET
  507.             {
  508.                 if($1 -> seg == SSG_UNDEF)
  509.                 {
  510.                     $1 -> seg = SSG_EQU;
  511.                     if( ($1->value = chtcreate()) <= 0)
  512.                     {
  513.         fraerror( "cannot create character translation table");
  514.                     }
  515.                     prtequvalue("C: 0x%lx\n", $1 -> value);
  516.                 }
  517.                 else
  518.                 {
  519.             fraerror( "multiple definition of label");
  520.                 }
  521.             }
  522.     |        KOC_CHUSE
  523.             {
  524.                 chtcpoint = (int *) NULL;
  525.                 prtequvalue("C: 0x%lx\n", 0L);
  526.             }
  527.     |        KOC_CHUSE expr
  528.             {
  529.                 pevalexpr(0, $2);
  530.                 if( evalr[0].seg == SSG_ABS)
  531.                 {
  532.                     if( evalr[0].value == 0)
  533.                     {
  534.                         chtcpoint = (int *)NULL;
  535.                         prtequvalue("C: 0x%lx\n", 0L);
  536.                     }
  537.                     else if(evalr[0].value < chtnxalph)
  538.                     {
  539.                 chtcpoint = chtatab[evalr[0].value];
  540.                 prtequvalue("C: 0x%lx\n", evalr[0].value);
  541.                     }
  542.                     else
  543.                     {
  544.             fraerror("nonexistent character translation table");
  545.                     }
  546.                 }
  547.                 else
  548.                 {
  549.                     fraerror("noncomputable expression");
  550.                 }
  551.             }
  552.     |        KOC_CHDEF STRING ',' exprlist
  553.             {
  554.         int findrv, numret, *charaddr;
  555.         char *sourcestr = $2, *before;
  556.  
  557.         if(chtnpoint != (int *)NULL)
  558.         {
  559.             for(satsub = 0; satsub < $4; satsub++)
  560.             {
  561.                 before = sourcestr;
  562.  
  563.                 pevalexpr(0, exprlist[satsub]);
  564.                 findrv = chtcfind(chtnpoint, &sourcestr,
  565.                         &charaddr, &numret);
  566.                 if(findrv == CF_END)
  567.                 {
  568.             fraerror("more expressions than characters");
  569.                     break;
  570.                 }
  571.  
  572.                 if(evalr[0].seg == SSG_ABS)
  573.                 {
  574.                     switch(findrv)
  575.                     {
  576.                     case CF_UNDEF:
  577.                         {
  578.                 if(evalr[0].value < 0 ||
  579.                     evalr[0].value > 255)
  580.                 {
  581.             frawarn("character translation value truncated");
  582.                 }
  583.                 *charaddr = evalr[0].value & 0xff;
  584.                 prtequvalue("C: 0x%lx\n", evalr[0].value);
  585.                         }
  586.                         break;
  587.  
  588.                     case CF_INVALID:
  589.                     case CF_NUMBER:
  590.                 fracherror("invalid character to define", 
  591.                     before, sourcestr);
  592.                         break;
  593.  
  594.                     case CF_CHAR:
  595.                 fracherror("character already defined", 
  596.                     before, sourcestr);
  597.                         break;
  598.                     }
  599.                 }
  600.                 else
  601.                 {
  602.                     fraerror("noncomputable expression");
  603.                 }
  604.             }
  605.  
  606.             if( *sourcestr != '\0')
  607.             {
  608.                 fraerror("more characters than expressions");
  609.             }
  610.         }
  611.         else
  612.         {
  613.             fraerror("no CHARSET statement active");
  614.         }
  615.             
  616.             }
  617.     |    LABEL 
  618.             {
  619.             if($1 -> seg == SSG_UNDEF)
  620.             {
  621.                 $1 -> seg = SSG_ABS;
  622.                 $1 -> value = labelloc;
  623.                 prtequvalue("C: 0x%lx\n", labelloc);
  624.  
  625.             }
  626.             else
  627.                 fraerror(
  628.                 "multiple definition of label");
  629.             }
  630.     |    labeledline
  631.     ;
  632.  
  633. labeledline :    LABEL genline
  634.             {
  635.             if($1 -> seg == SSG_UNDEF)
  636.             {
  637.                 $1 -> seg = SSG_ABS;
  638.                 $1 -> value = labelloc;
  639.             }
  640.             else
  641.                 fraerror(
  642.                 "multiple definition of label");
  643.             labelloc = locctr;
  644.             }
  645.                 
  646.     |    genline
  647.             {
  648.                 labelloc = locctr;
  649.             }
  650.     ;
  651.  
  652. genline    :    KOC_BDEF    exprlist 
  653.             {
  654.                 genlocrec(currseg, labelloc);
  655.                 for( satsub = 0; satsub < $2; satsub++)
  656.                 {
  657.                     pevalexpr(1, exprlist[satsub]);
  658.                     locctr += geninstr(genbdef);
  659.                 }
  660.             }
  661.     |    KOC_SDEF stringlist 
  662.             {
  663.                 genlocrec(currseg, labelloc);
  664.                 for(satsub = 0; satsub < $2; satsub++)
  665.                 {
  666.                     locctr += genstring(stringlist[satsub]);
  667.                 }
  668.             }
  669.     |    KOC_WDEF exprlist 
  670.             {
  671.                 genlocrec(currseg, labelloc);
  672.                 for( satsub = 0; satsub < $2; satsub++)
  673.                 {
  674.                     pevalexpr(1, exprlist[satsub]);
  675.                     locctr += geninstr(genwdef);
  676.                 }
  677.             }    
  678.     |    KOC_RESM expr 
  679.             {
  680.                 pevalexpr(0, $2);
  681.                 if(evalr[0].seg == SSG_ABS)
  682.                 {
  683.                     locctr = labelloc + evalr[0].value;
  684.                     prtequvalue("C: 0x%lx\n", labelloc);
  685.                 }
  686.                 else
  687.                 {
  688.                     fraerror(
  689.                  "noncomputable result for RMB expression");
  690.                 }
  691.             }
  692.     ;
  693.  
  694. exprlist :    exprlist ',' expr
  695.             {
  696.                 exprlist[nextexprs ++ ] = $3;
  697.                 $$ = nextexprs;
  698.             }
  699.     |    expr
  700.             {
  701.                 nextexprs = 0;
  702.                 exprlist[nextexprs ++ ] = $1;
  703.                 $$ = nextexprs;
  704.             }
  705.     ;
  706.  
  707. stringlist :    stringlist ',' STRING
  708.             {
  709.                 stringlist[nextstrs ++ ] = $3;
  710.                 $$ = nextstrs;
  711.             }
  712.     |    STRING
  713.             {
  714.                 nextstrs = 0;
  715.                 stringlist[nextstrs ++ ] = $1;
  716.                 $$ = nextstrs;
  717.             }
  718.     ;
  719.  
  720.  
  721. line    :    KOC_CPU STRING
  722.             {
  723.         if( ! cpumatch($2))
  724.         {
  725.             fraerror("unknown cpu type, 64180 assumed");
  726.             cpuselect = CPU64180;
  727.         }
  728.             }
  729.     ;
  730. genline : KOC_bit  expr ',' '(' DREGHL ')' 
  731.             {
  732.         genlocrec(currseg, labelloc);
  733.         pevalexpr(1,$2);
  734.         if(evalr[1].seg != SSG_ABS || 
  735.             evalr[1].value < 0 ||
  736.             evalr[1].value > 7)
  737.         {
  738.             evalr[1].value = 0;
  739.             fraerror("impossible bit number");
  740.         }
  741.         evalr[1].value <<= 3;
  742.         locctr += geninstr(findgen($1, ST_B01, cpuselect));
  743.             }
  744.     ;
  745. genline : KOC_bit  expr ',' index 
  746.             {
  747.         genlocrec(currseg, labelloc);
  748.         pevalexpr(1,$2);
  749.         if(evalr[1].seg != SSG_ABS || 
  750.             evalr[1].value < 0 ||
  751.             evalr[1].value > 7)
  752.         {
  753.             evalr[1].value = 0;
  754.             fraerror("impossible bit number");
  755.         }
  756.         evalr[1].value <<= 3;
  757.         pevalexpr(2, $4.exp);
  758.         locctr += geninstr(findgen($1, ST_B02, cpuselect|$4.indsel));
  759.             }
  760.     ;
  761. genline : KOC_bit  expr ',' reg8 
  762.             {
  763.         genlocrec(currseg, labelloc);
  764.         pevalexpr(1,$2);
  765.         if(evalr[1].seg != SSG_ABS || 
  766.             evalr[1].value < 0 ||
  767.             evalr[1].value > 7)
  768.         {
  769.             evalr[1].value = 0;
  770.             fraerror("impossible bit number");
  771.         }
  772.         evalr[1].value = (evalr[1].value << 3) | $4;
  773.         locctr += geninstr(findgen($1, ST_B03, cpuselect));
  774.             }
  775.     ;
  776. genline : KOC_ccop  '(' dreg ')' 
  777.             {
  778.         genlocrec(currseg, labelloc);
  779.         locctr += geninstr(findgen($1, ST_CC01, cpuselect|$3));
  780.             }
  781.     ;
  782. genline : KOC_ccop  condition ',' expr 
  783.             {
  784.         genlocrec(currseg, labelloc);
  785.         pevalexpr(1, $4);
  786.         locctr += geninstr(findgen($1, ST_CC02, cpuselect|$2));
  787.             }
  788.     ;
  789. genline : KOC_ccop  expr 
  790.             {
  791.         genlocrec(currseg, labelloc);
  792.         pevalexpr(1,$2);
  793.         locctr += geninstr(findgen($1, ST_CC03, cpuselect));
  794.             }
  795.     ;
  796. genline : KOC_ccop  condition  
  797.             {
  798.         genlocrec(currseg, labelloc);
  799.         locctr += geninstr(findgen($1, ST_CC04, cpuselect|$2));
  800.             }
  801.     ;
  802. genline : KOC_ccop  
  803.             {
  804.         genlocrec(currseg, labelloc);
  805.         locctr += geninstr(findgen($1, ST_CC05, cpuselect));
  806.             }
  807.     ;
  808. genline : KOC_exop  dreg ',' dreg 
  809.             {
  810.         int selc = 0;
  811.  
  812.         genlocrec(currseg, labelloc);
  813.         switch($2)
  814.         {
  815.         case DRAF:
  816.             selc = EX1AF;
  817.             break;
  818.         case DRDE:
  819.             selc = EX1DE;
  820.         default:
  821.             break;
  822.         }
  823.  
  824.         switch($4)
  825.         {
  826.         case DRAF:
  827.             selc |= EX2AF;
  828.             break;
  829.         case DRHL:
  830.             selc |= EX2HL;
  831.         default:
  832.             break;
  833.         }
  834.         locctr += geninstr(findgen($1, ST_EX01, cpuselect|selc));
  835.             }
  836.     ;
  837. genline : KOC_exop  '(' DREGSP ')' ',' dreg 
  838.             {
  839.         genlocrec(currseg, labelloc);
  840.         locctr += geninstr(findgen($1, ST_EX02, cpuselect|$6));
  841.             }
  842.     ;
  843. genline : KOC_intmode  expr 
  844.             {
  845.         int selc = 0;
  846.  
  847.         genlocrec(currseg, labelloc);
  848.         pevalexpr(1, $2);
  849.         if(evalr[1].seg != SSG_ABS ||
  850.            evalr[1].value < 0 ||
  851.            evalr[1].value > 2)
  852.         {
  853.             fraerror("invalid interrupt mode");
  854.         }
  855.         else
  856.         {
  857.             selc = 1 << ((int) evalr[1].value);
  858.         }
  859.         locctr += geninstr(findgen($1, ST_IM01, cpuselect|selc));
  860.             }
  861.     ;
  862. genline : KOC_ioop  '(' topexpr ')' ',' reg8 
  863.             {
  864.         genlocrec(currseg, labelloc);
  865.         pevalexpr(1, $3);
  866.         evalr[2].value = $6 << 3;
  867.         locctr += geninstr(findgen($1, ST_IO01, cpuselect
  868.             | ($6 == VALREGA ? REGISA : 0)));
  869.             }
  870.     ;
  871. genline : KOC_ioop  '(' REGC ')' ',' reg8 
  872.             {
  873.         genlocrec(currseg, labelloc);
  874.         evalr[1].value = $6 << 3;
  875.         locctr += geninstr(findgen($1, ST_IO02, cpuselect));
  876.             }
  877.     ;
  878. genline : KOC_ioop  reg8 ',' '(' topexpr ')' 
  879.             {
  880.         genlocrec(currseg, labelloc);
  881.         evalr[1].value = $2 << 3;
  882.         pevalexpr(2, $5);
  883.         locctr += geninstr(findgen($1, ST_IO03, cpuselect
  884.             | ($2 == VALREGA ? REGISA : 0)));
  885.             }
  886.     ;
  887. genline : KOC_ioop  reg8 ',' '(' REGC ')' 
  888.             {
  889.         genlocrec(currseg, labelloc);
  890.         evalr[1].value = $2 << 3;
  891.         locctr += geninstr(findgen($1, ST_IO04, cpuselect));
  892.             }
  893.     ;
  894. genline : KOC_ldop  '(' dreg ')' ',' topexpr 
  895.             {
  896.         genlocrec(currseg, labelloc);
  897.         pevalexpr(1, $6);
  898.         locctr += geninstr(findgen($1, ST_LD01, cpuselect|$3));
  899.             }
  900.     ;
  901. genline : KOC_ldop  '(' dreg ')' ',' reg8 
  902.             {
  903.         genlocrec(currseg, labelloc);
  904.         evalr[1].value = $6;
  905.         locctr += geninstr(findgen($1, ST_LD02, cpuselect
  906.             | $3 | ($6 == VALREGA ? REGISA : 0)));
  907.             }
  908.     ;
  909. genline : KOC_ldop  '(' topexpr ')' ',' dreg 
  910.             {
  911.         genlocrec(currseg, labelloc);
  912.         pevalexpr(1, $3);
  913.         locctr += geninstr(findgen($1, ST_LD03, cpuselect|$6));
  914.             }
  915.     ;
  916. genline : KOC_ldop  '(' topexpr ')' ',' REGA 
  917.             {
  918.         genlocrec(currseg, labelloc);
  919.         pevalexpr(1, $3);
  920.         locctr += geninstr(findgen($1, ST_LD04, cpuselect));
  921.             }
  922.     ;
  923. genline : KOC_ldop  dreg ',' '(' topexpr ')' 
  924.             {
  925.         genlocrec(currseg, labelloc);
  926.         pevalexpr(1, $5);
  927.         locctr += geninstr(findgen($1, ST_LD05, cpuselect|$2));
  928.             }
  929.     ;
  930. genline : KOC_ldop  dreg ',' dreg 
  931.             {
  932.         genlocrec(currseg, labelloc);
  933.         locctr += geninstr(findgen($1, ST_LD06, cpuselect|$4
  934.             | ($2 == DRSP ? DRDESTSP : 0)));
  935.             }
  936.     ;
  937. genline : KOC_ldop  dreg ',' topexpr 
  938.             {
  939.         genlocrec(currseg, labelloc);
  940.         pevalexpr(1, $4);
  941.         locctr += geninstr(findgen($1, ST_LD07, cpuselect|$2));
  942.             }
  943.     ;
  944. genline : KOC_ldop  index ',' expr 
  945.             {
  946.         genlocrec(currseg, labelloc);
  947.         pevalexpr(1, $2.exp);
  948.         pevalexpr(2, $4);
  949.         locctr += geninstr(findgen($1, ST_LD08, cpuselect|$2.indsel));
  950.             }
  951.     ;
  952. genline : KOC_ldop  index ',' reg8 
  953.             {
  954.         genlocrec(currseg, labelloc);
  955.         pevalexpr(1,$2.exp);
  956.         evalr[2].value = $4;
  957.         locctr += geninstr(findgen($1, ST_LD09, cpuselect|$2.indsel));
  958.             }
  959.     ;
  960. genline : KOC_ldop  reg8 ',' '(' dreg ')' 
  961.             {
  962.         genlocrec(currseg, labelloc);
  963.         evalr[1].value = $2 << 3;
  964.         locctr += geninstr(findgen($1, ST_LD10, cpuselect
  965.             | $5 | ($2 == VALREGA ? REGISA : 0)));
  966.             }
  967.     ;
  968. genline : KOC_ldop  reg8 ',' topexpr 
  969.             {
  970.         genlocrec(currseg, labelloc);
  971.         evalr[1].value = $2 << 3;
  972.         pevalexpr(2, $4);
  973.         locctr += geninstr(findgen($1, ST_LD11, cpuselect));
  974.             }
  975.     ;
  976. genline : KOC_ldop  reg8 ',' index 
  977.             {
  978.         genlocrec(currseg, labelloc);
  979.         evalr[1].value = $2 << 3;
  980.         pevalexpr(2, $4.exp);
  981.         locctr += geninstr(findgen($1, ST_LD12, cpuselect|$4.indsel));
  982.             }
  983.     ;
  984. genline : KOC_ldop  reg8 ',' reg8 
  985.             {
  986.         genlocrec(currseg, labelloc);
  987.         evalr[1].value = ($2 << 3 ) | $4;
  988.         locctr += geninstr(findgen($1, ST_LD13, cpuselect));
  989.             }
  990.     ;
  991. genline : KOC_ldop  reg8 ',' '(' topexpr ')' 
  992.             {
  993.         genlocrec(currseg, labelloc);
  994.         pevalexpr(1, $5);
  995.         locctr += geninstr(findgen($1, ST_LD14, cpuselect
  996.             | ($2 == VALREGA ? REGISA : 0)));
  997.             }
  998.     ;
  999. genline : KOC_ldop  reg8 ',' specialr 
  1000.             {
  1001.         genlocrec(currseg, labelloc);
  1002.         locctr += geninstr(findgen($1, ST_LD15, cpuselect|$4
  1003.             | ($2 == VALREGA ? REGISA : 0)));
  1004.             }
  1005.     ;
  1006. genline : KOC_ldop  specialr ',' REGA 
  1007.             {
  1008.         genlocrec(currseg, labelloc);
  1009.         locctr += geninstr(findgen($1, ST_LD16, cpuselect|$2));
  1010.             }
  1011.     ;
  1012. genline : KOC_opcode 
  1013.             {
  1014.         genlocrec(currseg, labelloc);
  1015.         locctr += geninstr(findgen($1, ST_N01, cpuselect));
  1016.             }
  1017.     ;
  1018. genline : KOC_opcode  '(' DREGHL ')' 
  1019.             {
  1020.         genlocrec(currseg, labelloc);
  1021.         locctr += geninstr(findgen($1, ST_N02, cpuselect));
  1022.             }
  1023.     ;
  1024. genline : KOC_opcode  dreg 
  1025.             {
  1026.         genlocrec(currseg, labelloc);
  1027.         locctr += geninstr(findgen($1, ST_N04, cpuselect|$2));
  1028.             }
  1029.     ;
  1030. genline : KOC_opcode  dreg ',' dreg 
  1031.             {
  1032.         int selc = 0;
  1033.  
  1034.         genlocrec(currseg, labelloc);
  1035.         switch($2)
  1036.         {
  1037.         case DRIX:
  1038.             selc = DRDESTIX;
  1039.             break;
  1040.         case DRIY:
  1041.             selc = DRDESTIY;
  1042.             break;
  1043.         case DRHL:
  1044.             selc = DRDESTHL;
  1045.         default:
  1046.             break;
  1047.         }
  1048.         locctr += geninstr(findgen($1, ST_N05, cpuselect
  1049.             | $4| selc));
  1050.             }
  1051.     ;
  1052. genline : KOC_opcode  topexpr 
  1053.             {
  1054.         genlocrec(currseg, labelloc);
  1055.         pevalexpr(1, $2);
  1056.         locctr += geninstr(findgen($1, ST_N06, cpuselect));
  1057.             }
  1058.     ;
  1059. genline : KOC_opcode  index 
  1060.             {
  1061.         genlocrec(currseg, labelloc);
  1062.         pevalexpr(1, $2.exp);
  1063.         locctr += geninstr(findgen($1, ST_N07, cpuselect|$2.indsel));
  1064.             }
  1065.     ;
  1066. genline : KOC_opcode  reg8 
  1067.             {
  1068.         genlocrec(currseg, labelloc);
  1069.         evalr[1].value = $2;
  1070.         evalr[2].value = $2 << 3;
  1071.         locctr += geninstr(findgen($1, ST_N08, cpuselect));
  1072.             }
  1073.     ;
  1074. genline : KOC_opcode  reg8 ',' '(' DREGHL ')' 
  1075.             {
  1076.         genlocrec(currseg, labelloc);
  1077.         locctr += geninstr(findgen($1, ST_N09, cpuselect
  1078.             | ($2 == VALREGA ? REGISA : 0)));
  1079.             }
  1080.     ;
  1081. genline : KOC_opcode  reg8 ',' topexpr 
  1082.             {
  1083.         genlocrec(currseg, labelloc);
  1084.         pevalexpr(1, $4);
  1085.         locctr += geninstr(findgen($1, ST_N10, cpuselect
  1086.             | ($2 == VALREGA ? REGISA : 0)));
  1087.             }
  1088.     ;
  1089. genline : KOC_opcode  reg8 ',' index 
  1090.             {
  1091.         genlocrec(currseg, labelloc);
  1092.         pevalexpr(1, $4.exp);
  1093.         locctr += geninstr(findgen($1, ST_N11, cpuselect|$4.indsel
  1094.             | ($2 == VALREGA ? REGISA : 0)));
  1095.             }
  1096.     ;
  1097. genline : KOC_opcode  reg8 ',' reg8 
  1098.             {
  1099.         genlocrec(currseg, labelloc);
  1100.         evalr[1].value = $4;
  1101.         locctr += geninstr(findgen($1, ST_N12, cpuselect
  1102.             | ($2 == VALREGA ? REGISA : 0)));
  1103.             }
  1104.     ;
  1105. genline : KOC_restart  expr 
  1106.             {
  1107.         int selc = 0;
  1108.  
  1109.         genlocrec(currseg, labelloc);
  1110.         pevalexpr(1, $2);
  1111.         if(evalr[1].seg != SSG_ABS)
  1112.         {
  1113.             fraerror("noncomputable expression for address");
  1114.         }
  1115.         else
  1116.         {
  1117.             selc = evalr[1].value;
  1118.             switch(selc)
  1119.             {
  1120.             case 0:
  1121.             case 0x8:
  1122.             case 0x10:
  1123.             case 0x18:
  1124.             case 0x20:
  1125.             case 0x28:
  1126.             case 0x30:
  1127.             case 0x38:
  1128.                 break;
  1129.             default:
  1130.                 fraerror("invalid value for reset expression");
  1131.                 break;
  1132.             }
  1133.         }
  1134.         evalr[1].value &= 070;    
  1135.         locctr += geninstr(findgen($1, ST_R01, cpuselect));
  1136.             }
  1137.     ;
  1138.  
  1139. reg8    :    REGA
  1140.     |    REGB
  1141.     |    REGC
  1142.     |    REGD
  1143.     |    REGE
  1144.     |    REGH
  1145.     |    REGL
  1146.     ;
  1147.  
  1148. dreg    :    DREGAF
  1149.     |    DREGBC
  1150.     |    DREGDE
  1151.     |    DREGHL
  1152.     |    DREGIX
  1153.     |    DREGIY
  1154.     |    DREGSP
  1155.     ;
  1156.  
  1157. condition :    CONDZ
  1158.     |    CONDNZ
  1159.     |    CONDNC
  1160.     |    CONDPE
  1161.     |    CONDPO
  1162.     |    CONDP
  1163.     |    CONDM
  1164.     |    REGC
  1165.             {
  1166.         $$ = CCSELC;
  1167.             }
  1168.     ;
  1169.  
  1170. specialr :    SREGI
  1171.     |    SREGR
  1172.     ;
  1173.  
  1174. index :    '(' ixoriy '+' expr ')'
  1175.             {
  1176.         $$.exp = $4;
  1177.         $$.indsel = $2;
  1178.             }
  1179.     ;
  1180.  
  1181. ixoriy    :    DREGIX
  1182.     |    DREGIY
  1183.     ;
  1184.  
  1185. topexpr    :    '+' expr %prec KEOP_MUN
  1186.             {
  1187.                 $$ = $2;
  1188.             }
  1189.     |    '-' expr %prec KEOP_MUN
  1190.             {
  1191.                 $$ = exprnode(PCCASE_UN,$2,IFC_NEG,0,0L,
  1192.                     SYMNULL);
  1193.             }
  1194.     |    KEOP_NOT expr
  1195.             {
  1196.                 $$ = exprnode(PCCASE_UN,$2,IFC_NOT,0,0L,
  1197.                     SYMNULL);
  1198.             }
  1199.     |    KEOP_HIGH expr
  1200.             {
  1201.                 $$ = exprnode(PCCASE_UN,$2,IFC_HIGH,0,0L,
  1202.                     SYMNULL);
  1203.             }
  1204.     |    KEOP_LOW expr
  1205.             {
  1206.                 $$ = exprnode(PCCASE_UN,$2,IFC_LOW,0,0L,
  1207.                     SYMNULL);
  1208.             }
  1209.     |    expr '*' expr
  1210.             {
  1211.                 $$ = exprnode(PCCASE_BIN,$1,IFC_MUL,$3,0L,
  1212.                     SYMNULL);
  1213.             }
  1214.     |    expr '/' expr
  1215.             {
  1216.                 $$ = exprnode(PCCASE_BIN,$1,IFC_DIV,$3,0L,
  1217.                     SYMNULL);
  1218.             }
  1219.     |    expr '+' expr
  1220.             {
  1221.                 $$ = exprnode(PCCASE_BIN,$1,IFC_ADD,$3,0L,
  1222.                     SYMNULL);
  1223.             }
  1224.     |    expr '-' expr
  1225.             {
  1226.                 $$ = exprnode(PCCASE_BIN,$1,IFC_SUB,$3,0L,
  1227.                     SYMNULL);
  1228.             }
  1229.     |    expr KEOP_MOD expr
  1230.             {
  1231.                 $$ = exprnode(PCCASE_BIN,$1,IFC_MOD,$3,0L,
  1232.                     SYMNULL);
  1233.             }
  1234.     |    expr KEOP_SHL expr
  1235.             {
  1236.                 $$ = exprnode(PCCASE_BIN,$1,IFC_SHL,$3,0L,
  1237.                     SYMNULL);
  1238.             }
  1239.     |    expr KEOP_SHR expr
  1240.             {
  1241.                 $$ = exprnode(PCCASE_BIN,$1,IFC_SHR,$3,0L,
  1242.                     SYMNULL);
  1243.             }
  1244.     |    expr KEOP_GT expr
  1245.             {
  1246.                 $$ = exprnode(PCCASE_BIN,$1,IFC_GT,$3,0L,
  1247.                     SYMNULL);
  1248.             }
  1249.     |    expr KEOP_GE expr
  1250.             {
  1251.                 $$ = exprnode(PCCASE_BIN,$1,IFC_GE,$3,0L,
  1252.                     SYMNULL);
  1253.             }
  1254.     |    expr KEOP_LT expr
  1255.             {
  1256.                 $$ = exprnode(PCCASE_BIN,$1,IFC_LT,$3,0L,
  1257.                     SYMNULL);
  1258.             }
  1259.     |    expr KEOP_LE expr
  1260.             {
  1261.                 $$ = exprnode(PCCASE_BIN,$1,IFC_LE,$3,0L,
  1262.                     SYMNULL);
  1263.             }
  1264.     |    expr KEOP_NE expr
  1265.             {
  1266.                 $$ = exprnode(PCCASE_BIN,$1,IFC_NE,$3,0L,
  1267.                     SYMNULL);
  1268.             }
  1269.     |    expr KEOP_EQ expr
  1270.             {
  1271.                 $$ = exprnode(PCCASE_BIN,$1,IFC_EQ,$3,0L,
  1272.                     SYMNULL);
  1273.             }
  1274.     |    expr KEOP_AND expr
  1275.             {
  1276.                 $$ = exprnode(PCCASE_BIN,$1,IFC_AND,$3,0L,
  1277.                     SYMNULL);
  1278.             }
  1279.     |    expr KEOP_OR expr
  1280.             {
  1281.                 $$ = exprnode(PCCASE_BIN,$1,IFC_OR,$3,0L,
  1282.                     SYMNULL);
  1283.             }
  1284.     |    expr KEOP_XOR expr
  1285.             {
  1286.                 $$ = exprnode(PCCASE_BIN,$1,IFC_XOR,$3,0L,
  1287.                     SYMNULL);
  1288.             }
  1289.     |    KEOP_DEFINED SYMBOL
  1290.             {
  1291.                 $$ = exprnode(PCCASE_DEF,0,IGP_DEFINED,0,0L,$2);
  1292.             }
  1293.     |    SYMBOL
  1294.             {
  1295.                 $$ = exprnode(PCCASE_SYMB,0,IFC_SYMB,0,0L,$1);
  1296.             }
  1297.     |    '*'
  1298.             {
  1299.                 $$ = exprnode(PCCASE_PROGC,0,IFC_PROGCTR,0,
  1300.                     labelloc, SYMNULL);
  1301.             }
  1302.     |    CONSTANT
  1303.             {
  1304.                 $$ = exprnode(PCCASE_CONS,0,IGP_CONSTANT,0,$1,
  1305.                     SYMNULL);
  1306.             }
  1307.     |    STRING
  1308.             {
  1309.                 char *sourcestr = $1;
  1310.                 long accval = 0;
  1311.  
  1312.                 if(strlen($1) > 0)
  1313.                 {
  1314.                     accval = chtran(&sourcestr);
  1315.                     if(*sourcestr != '\0')
  1316.                     {
  1317.                         accval = (accval << 8) +
  1318.                             chtran(&sourcestr);
  1319.                     }
  1320.  
  1321.                     if( *sourcestr != '\0')
  1322.                     {
  1323.     frawarn("string constant in expression more than 2 characters long");
  1324.                     }
  1325.                 }
  1326.                 $$ = exprnode(PCCASE_CONS, 0, IGP_CONSTANT, 0,
  1327.                     accval, SYMNULL);
  1328.             }
  1329.     ;
  1330.  
  1331. expr    :    '(' topexpr ')'
  1332.             {
  1333.                 $$ = $2;
  1334.             }
  1335.     |    topexpr
  1336.     ;
  1337.  
  1338.  
  1339.  
  1340. %%
  1341.  
  1342. lexintercept()
  1343. /*
  1344.     description    intercept the call to yylex (the lexical analyzer)
  1345.             and filter out all unnecessary tokens when skipping
  1346.             the input between a failed IF and its matching ENDI or
  1347.             ELSE
  1348.     globals     fraifskip    the enable flag
  1349. */
  1350. {
  1351. #undef yylex
  1352.  
  1353.     int rv;
  1354.  
  1355.     if(fraifskip)
  1356.     {
  1357.         for(;;)
  1358.         {
  1359.  
  1360.             switch(rv = yylex())
  1361.  
  1362.             {
  1363.             case 0:
  1364.             case KOC_END:
  1365.             case KOC_IF:
  1366.             case KOC_ELSE:
  1367.             case KOC_ENDI:
  1368.             case EOL:
  1369.                 return rv;
  1370.             default:
  1371.                 break;
  1372.             }
  1373.         }
  1374.     }
  1375.     else
  1376.         return yylex();
  1377. #define yylex lexintercept
  1378. }
  1379.  
  1380.  
  1381. setreserved()
  1382. {
  1383.  
  1384.     reservedsym("and", KEOP_AND, 0);
  1385.     reservedsym("defined", KEOP_DEFINED,0);
  1386.     reservedsym("eq", KEOP_EQ, 0);
  1387.     reservedsym("ge", KEOP_GE, 0);
  1388.     reservedsym("gt", KEOP_GT, 0);
  1389.     reservedsym("high", KEOP_HIGH, 0);
  1390.     reservedsym("le", KEOP_LE, 0);
  1391.     reservedsym("low", KEOP_LOW, 0);
  1392.     reservedsym("lt", KEOP_LT, 0);
  1393.     reservedsym("mod", KEOP_MOD, 0);
  1394.     reservedsym("ne", KEOP_NE, 0);
  1395.     reservedsym("not", KEOP_NOT, 0);
  1396.     reservedsym("or", KEOP_OR, 0);
  1397.     reservedsym("shl", KEOP_SHL, 0);
  1398.     reservedsym("shr", KEOP_SHR, 0);
  1399.     reservedsym("xor", KEOP_XOR, 0);
  1400.     reservedsym("AND", KEOP_AND, 0);
  1401.     reservedsym("DEFINED", KEOP_DEFINED,0);
  1402.     reservedsym("EQ", KEOP_EQ, 0);
  1403.     reservedsym("GE", KEOP_GE, 0);
  1404.     reservedsym("GT", KEOP_GT, 0);
  1405.     reservedsym("HIGH", KEOP_HIGH, 0);
  1406.     reservedsym("LE", KEOP_LE, 0);
  1407.     reservedsym("LOW", KEOP_LOW, 0);
  1408.     reservedsym("LT", KEOP_LT, 0);
  1409.     reservedsym("MOD", KEOP_MOD, 0);
  1410.     reservedsym("NE", KEOP_NE, 0);
  1411.     reservedsym("NOT", KEOP_NOT, 0);
  1412.     reservedsym("OR", KEOP_OR, 0);
  1413.     reservedsym("SHL", KEOP_SHL, 0);
  1414.     reservedsym("SHR", KEOP_SHR, 0);
  1415.     reservedsym("XOR", KEOP_XOR, 0);
  1416.  
  1417.     reservedsym("i",SREGI,SPECIALIR);
  1418.     reservedsym("r",SREGR,SPECIALRR);
  1419.     reservedsym("I",SREGI,SPECIALIR);
  1420.     reservedsym("R",SREGR,SPECIALRR);
  1421.     reservedsym("a",REGA,VALREGA);
  1422.     reservedsym("b",REGB,VALREGB);
  1423.     reservedsym("c",REGC,VALREGC);
  1424.     reservedsym("d",REGD,VALREGD);
  1425.     reservedsym("e",REGE,VALREGE);
  1426.     reservedsym("h",REGH,VALREGH);
  1427.     reservedsym("l",REGL,VALREGL);
  1428.     reservedsym("af",DREGAF,DRAF);
  1429.     reservedsym("bc",DREGBC,DRBC);
  1430.     reservedsym("de",DREGDE,DRDE);
  1431.     reservedsym("hl",DREGHL,DRHL);
  1432.     reservedsym("ix",DREGIX,DRIX);
  1433.     reservedsym("iy",DREGIY,DRIY);
  1434.     reservedsym("sp",DREGSP,DRSP);
  1435.     reservedsym("z",CONDZ,CCSELZ);
  1436.     reservedsym("nz",CONDNZ,CCSELNZ);
  1437.     reservedsym("nc",CONDNC,CCSELNC);
  1438.     reservedsym("pe",CONDPE,CCSELPE);
  1439.     reservedsym("po",CONDPO,CCSELPO);
  1440.     reservedsym("p",CONDP,CCSELP);
  1441.     reservedsym("m",CONDM,CCSELM);
  1442.     reservedsym("A",REGA,VALREGA);
  1443.     reservedsym("B",REGB,VALREGB);
  1444.     reservedsym("C",REGC,VALREGC);
  1445.     reservedsym("D",REGD,VALREGD);
  1446.     reservedsym("E",REGE,VALREGE);
  1447.     reservedsym("H",REGH,VALREGH);
  1448.     reservedsym("L",REGL,VALREGL);
  1449.     reservedsym("AF",DREGAF,DRAF);
  1450.     reservedsym("BC",DREGBC,DRBC);
  1451.     reservedsym("DE",DREGDE,DRDE);
  1452.     reservedsym("HL",DREGHL,DRHL);
  1453.     reservedsym("IX",DREGIX,DRIX);
  1454.     reservedsym("IY",DREGIY,DRIY);
  1455.     reservedsym("SP",DREGSP,DRSP);
  1456.     reservedsym("Z",CONDZ,CCSELZ);
  1457.     reservedsym("NZ",CONDNZ,CCSELNZ);
  1458.     reservedsym("NC",CONDNC,CCSELNC);
  1459.     reservedsym("PE",CONDPE,CCSELPE);
  1460.     reservedsym("PO",CONDPO,CCSELPO);
  1461.     reservedsym("P",CONDP,CCSELP);
  1462.     reservedsym("M",CONDM,CCSELM);
  1463.  
  1464. }
  1465.  
  1466. cpumatch(str)
  1467.     char * str;
  1468. {
  1469.     int msub;
  1470.  
  1471.     static struct
  1472.     {
  1473.         char * mtch;
  1474.         int   cpuv;
  1475.     } matchtab[] =
  1476.     {
  1477.         {"180", CPU64180},
  1478.         {"z80", CPUZ80},
  1479.         {"Z80", CPUZ80},
  1480.         {"85", CPU8085},
  1481.         {"80", CPU8080},
  1482.         {"", 0} 
  1483.     };
  1484.  
  1485.     for(msub = 0; matchtab[msub].cpuv != 0; msub++)
  1486.     {
  1487.         if(strcontains(str, matchtab[msub].mtch))
  1488.         {
  1489.             cpuselect = matchtab[msub].cpuv;
  1490.             return TRUE;
  1491.         }
  1492.     }
  1493.  
  1494.     return FALSE;
  1495. }
  1496.  
  1497. strcontains(s1, sm)
  1498.     char * s1, *sm;
  1499. {
  1500.     int l1 = strlen(s1), lm = strlen(sm);
  1501.  
  1502.     for(; l1 >= lm; l1--, s1++)
  1503.     {
  1504.         if(strncmp(s1, sm, lm) == 0)
  1505.         {
  1506.             return TRUE;
  1507.         }
  1508.     }
  1509.     return FALSE;
  1510. }
  1511.  
  1512. /*
  1513.     description    Opcode and Instruction generation tables
  1514.     usage        Unix, framework crossassembler
  1515.     history        September 25, 1987
  1516. */
  1517.  
  1518. #define NUMOPCODE 104
  1519. #define NUMSYNBLK 159
  1520. #define NUMDIFFOP 276
  1521.  
  1522. int gnumopcode = NUMOPCODE;
  1523.  
  1524. int ophashlnk[NUMOPCODE];
  1525.  
  1526. struct opsym optab[NUMOPCODE+1]
  1527.     = {
  1528.     {"invalid", KOC_opcode, 2, 0 },
  1529.     {"ADC", KOC_opcode, 5, 2 },
  1530.     {"ADD", KOC_opcode, 5, 7 },
  1531.     {"AND", KOC_opcode, 4, 12 },
  1532.     {"BIT", KOC_bit, 3, 16 },
  1533.     {"BYTE", KOC_BDEF, 0, 0 },
  1534.     {"CALL", KOC_ccop, 2, 19 },
  1535.     {"CCF", KOC_opcode, 1, 21 },
  1536.     {"CHARDEF", KOC_CHDEF, 0, 0 },
  1537.     {"CHARSET", KOC_CHSET, 0, 0 },
  1538.     {"CHARUSE", KOC_CHUSE, 0, 0 },
  1539.     {"CHD", KOC_CHDEF, 0, 0 },
  1540.     {"CP", KOC_opcode, 4, 22 },
  1541.     {"CPD", KOC_opcode, 1, 26 },
  1542.     {"CPDR", KOC_opcode, 1, 27 },
  1543.     {"CPI", KOC_opcode, 1, 28 },
  1544.     {"CPIR", KOC_opcode, 1, 29 },
  1545.     {"CPL", KOC_opcode, 1, 30 },
  1546.     {"CPU", KOC_CPU, 0, 0 },
  1547.     {"DAA", KOC_opcode, 1, 31 },
  1548.     {"DB", KOC_BDEF, 0, 0 },
  1549.     {"DEC", KOC_opcode, 4, 32 },
  1550.     {"DI", KOC_opcode, 1, 36 },
  1551.     {"DJNZ", KOC_opcode, 1, 37 },
  1552.     {"DW", KOC_WDEF, 0, 0 },
  1553.     {"EI", KOC_opcode, 1, 38 },
  1554.     {"ELSE", KOC_ELSE, 0, 0 },
  1555.     {"END", KOC_END, 0, 0 },
  1556.     {"ENDI", KOC_ENDI, 0, 0 },
  1557.     {"EQU", KOC_EQU, 0, 0 },
  1558.     {"EX", KOC_exop, 2, 39 },
  1559.     {"EXX", KOC_opcode, 1, 41 },
  1560.     {"FCB", KOC_BDEF, 0, 0 },
  1561.     {"FCC", KOC_SDEF, 0, 0 },
  1562.     {"FDB", KOC_WDEF, 0, 0 },
  1563.     {"HALT", KOC_opcode, 1, 42 },
  1564.     {"IF", KOC_IF, 0, 0 },
  1565.     {"IM", KOC_intmode, 1, 43 },
  1566.     {"IN0", KOC_ioop, 1, 44 },
  1567.     {"IN", KOC_ioop, 2, 45 },
  1568.     {"INC", KOC_opcode, 4, 47 },
  1569.     {"INCL", KOC_INCLUDE, 0, 0 },
  1570.     {"INCLUDE", KOC_INCLUDE, 0, 0 },
  1571.     {"IND", KOC_opcode, 1, 51 },
  1572.     {"INDR", KOC_opcode, 1, 52 },
  1573.     {"INI", KOC_opcode, 1, 53 },
  1574.     {"INIR", KOC_opcode, 1, 54 },
  1575.     {"JP", KOC_ccop, 3, 55 },
  1576.     {"JR", KOC_ccop, 2, 58 },
  1577.     {"LD", KOC_ldop, 16, 60 },
  1578.     {"LDD", KOC_opcode, 1, 76 },
  1579.     {"LDDR", KOC_opcode, 1, 77 },
  1580.     {"LDI", KOC_opcode, 1, 78 },
  1581.     {"LDIR", KOC_opcode, 1, 79 },
  1582.     {"MULT", KOC_opcode, 1, 80 },
  1583.     {"NEG", KOC_opcode, 1, 81 },
  1584.     {"NOP", KOC_opcode, 1, 82 },
  1585.     {"OR", KOC_opcode, 4, 83 },
  1586.     {"ORG", KOC_ORG, 0, 0 },
  1587.     {"OTDM", KOC_opcode, 1, 87 },
  1588.     {"OTDMR", KOC_opcode, 1, 88 },
  1589.     {"OTDR", KOC_opcode, 1, 89 },
  1590.     {"OTIM", KOC_opcode, 1, 90 },
  1591.     {"OTIMR", KOC_opcode, 1, 91 },
  1592.     {"OTIR", KOC_opcode, 1, 92 },
  1593.     {"OUT0", KOC_ioop, 1, 93 },
  1594.     {"OUT", KOC_ioop, 2, 94 },
  1595.     {"OUTD", KOC_opcode, 1, 96 },
  1596.     {"OUTI", KOC_opcode, 1, 97 },
  1597.     {"POP", KOC_opcode, 1, 98 },
  1598.     {"PUSH", KOC_opcode, 1, 99 },
  1599.     {"RES", KOC_bit, 3, 100 },
  1600.     {"RESERVE", KOC_RESM, 0, 0 },
  1601.     {"RET", KOC_ccop, 2, 103 },
  1602.     {"RETI", KOC_opcode, 1, 105 },
  1603.     {"RETN", KOC_opcode, 1, 106 },
  1604.     {"RIM", KOC_opcode, 1, 107 },
  1605.     {"RL", KOC_opcode, 3, 108 },
  1606.     {"RLA", KOC_opcode, 1, 111 },
  1607.     {"RLC", KOC_opcode, 3, 112 },
  1608.     {"RLCA", KOC_opcode, 1, 115 },
  1609.     {"RLD", KOC_opcode, 1, 116 },
  1610.     {"RMB", KOC_RESM, 0, 0 },
  1611.     {"RR", KOC_opcode, 3, 117 },
  1612.     {"RRA", KOC_opcode, 1, 120 },
  1613.     {"RRC", KOC_opcode, 3, 121 },
  1614.     {"RRCA", KOC_opcode, 1, 124 },
  1615.     {"RRD", KOC_opcode, 1, 125 },
  1616.     {"RST", KOC_restart, 1, 126 },
  1617.     {"SBC", KOC_opcode, 5, 127 },
  1618.     {"SCF", KOC_opcode, 1, 132 },
  1619.     {"SET", KOC_bit, 3, 133 },
  1620.     {"SETEQU", KOC_SET, 0, 0 },
  1621.     {"SIM", KOC_opcode, 1, 136 },
  1622.     {"SLA", KOC_opcode, 3, 137 },
  1623.     {"SLP", KOC_opcode, 1, 140 },
  1624.     {"SRA", KOC_opcode, 3, 141 },
  1625.     {"SRL", KOC_opcode, 3, 144 },
  1626.     {"STRING", KOC_SDEF, 0, 0 },
  1627.     {"SUB", KOC_opcode, 4, 147 },
  1628.     {"TST", KOC_opcode, 3, 151 },
  1629.     {"TSTIO", KOC_opcode, 1, 154 },
  1630.     {"WORD", KOC_WDEF, 0, 0 },
  1631.     {"XOR", KOC_opcode, 4, 155 },
  1632.     { "", 0, 0, 0 }};
  1633.  
  1634. struct opsynt ostab[NUMSYNBLK+1]
  1635.     = {
  1636. /* invalid 0 */ { 0, 1, 0 },
  1637. /* invalid 1 */ { 0xffff, 1, 1 },
  1638. /* ADC 2 */ { ST_N05, 4, 2 },
  1639. /* ADC 3 */ { ST_N09, 1, 6 },
  1640. /* ADC 4 */ { ST_N10, 1, 7 },
  1641. /* ADC 5 */ { ST_N11, 2, 8 },
  1642. /* ADC 6 */ { ST_N12, 1, 10 },
  1643. /* ADD 7 */ { ST_N05, 12, 11 },
  1644. /* ADD 8 */ { ST_N09, 1, 23 },
  1645. /* ADD 9 */ { ST_N10, 1, 24 },
  1646. /* ADD 10 */ { ST_N11, 2, 25 },
  1647. /* ADD 11 */ { ST_N12, 1, 27 },
  1648. /* AND 12 */ { ST_N02, 1, 28 },
  1649. /* AND 13 */ { ST_N06, 1, 29 },
  1650. /* AND 14 */ { ST_N07, 2, 30 },
  1651. /* AND 15 */ { ST_N08, 1, 32 },
  1652. /* BIT 16 */ { ST_B01, 1, 33 },
  1653. /* BIT 17 */ { ST_B02, 2, 34 },
  1654. /* BIT 18 */ { ST_B03, 1, 36 },
  1655. /* CALL 19 */ { ST_CC02, 8, 37 },
  1656. /* CALL 20 */ { ST_CC03, 1, 45 },
  1657. /* CCF 21 */ { ST_N01, 1, 46 },
  1658. /* CP 22 */ { ST_N02, 1, 47 },
  1659. /* CP 23 */ { ST_N06, 1, 48 },
  1660. /* CP 24 */ { ST_N07, 2, 49 },
  1661. /* CP 25 */ { ST_N08, 1, 51 },
  1662. /* CPD 26 */ { ST_N01, 1, 52 },
  1663. /* CPDR 27 */ { ST_N01, 1, 53 },
  1664. /* CPI 28 */ { ST_N01, 1, 54 },
  1665. /* CPIR 29 */ { ST_N01, 1, 55 },
  1666. /* CPL 30 */ { ST_N01, 1, 56 },
  1667. /* DAA 31 */ { ST_N01, 1, 57 },
  1668. /* DEC 32 */ { ST_N02, 1, 58 },
  1669. /* DEC 33 */ { ST_N04, 6, 59 },
  1670. /* DEC 34 */ { ST_N07, 2, 65 },
  1671. /* DEC 35 */ { ST_N08, 1, 67 },
  1672. /* DI 36 */ { ST_N01, 1, 68 },
  1673. /* DJNZ 37 */ { ST_N06, 1, 69 },
  1674. /* EI 38 */ { ST_N01, 1, 70 },
  1675. /* EX 39 */ { ST_EX01, 2, 71 },
  1676. /* EX 40 */ { ST_EX02, 3, 73 },
  1677. /* EXX 41 */ { ST_N01, 1, 76 },
  1678. /* HALT 42 */ { ST_N01, 1, 77 },
  1679. /* IM 43 */ { ST_IM01, 3, 78 },
  1680. /* IN0 44 */ { ST_IO03, 1, 81 },
  1681. /* IN 45 */ { ST_IO03, 1, 82 },
  1682. /* IN 46 */ { ST_IO04, 1, 83 },
  1683. /* INC 47 */ { ST_N02, 1, 84 },
  1684. /* INC 48 */ { ST_N04, 6, 85 },
  1685. /* INC 49 */ { ST_N07, 2, 91 },
  1686. /* INC 50 */ { ST_N08, 1, 93 },
  1687. /* IND 51 */ { ST_N01, 1, 94 },
  1688. /* INDR 52 */ { ST_N01, 1, 95 },
  1689. /* INI 53 */ { ST_N01, 1, 96 },
  1690. /* INIR 54 */ { ST_N01, 1, 97 },
  1691. /* JP 55 */ { ST_CC01, 3, 98 },
  1692. /* JP 56 */ { ST_CC02, 8, 101 },
  1693. /* JP 57 */ { ST_CC03, 1, 109 },
  1694. /* JR 58 */ { ST_CC02, 4, 110 },
  1695. /* JR 59 */ { ST_CC03, 1, 114 },
  1696. /* LD 60 */ { ST_LD01, 1, 115 },
  1697. /* LD 61 */ { ST_LD02, 3, 116 },
  1698. /* LD 62 */ { ST_LD03, 6, 119 },
  1699. /* LD 63 */ { ST_LD04, 1, 125 },
  1700. /* LD 64 */ { ST_LD05, 6, 126 },
  1701. /* LD 65 */ { ST_LD06, 3, 132 },
  1702. /* LD 66 */ { ST_LD07, 6, 135 },
  1703. /* LD 67 */ { ST_LD08, 2, 141 },
  1704. /* LD 68 */ { ST_LD09, 2, 143 },
  1705. /* LD 69 */ { ST_LD10, 3, 145 },
  1706. /* LD 70 */ { ST_LD11, 1, 148 },
  1707. /* LD 71 */ { ST_LD12, 2, 149 },
  1708. /* LD 72 */ { ST_LD13, 1, 151 },
  1709. /* LD 73 */ { ST_LD14, 1, 152 },
  1710. /* LD 74 */ { ST_LD15, 2, 153 },
  1711. /* LD 75 */ { ST_LD16, 2, 155 },
  1712. /* LDD 76 */ { ST_N01, 1, 157 },
  1713. /* LDDR 77 */ { ST_N01, 1, 158 },
  1714. /* LDI 78 */ { ST_N01, 1, 159 },
  1715. /* LDIR 79 */ { ST_N01, 1, 160 },
  1716. /* MULT 80 */ { ST_N04, 4, 161 },
  1717. /* NEG 81 */ { ST_N01, 1, 165 },
  1718. /* NOP 82 */ { ST_N01, 1, 166 },
  1719. /* OR 83 */ { ST_N02, 1, 167 },
  1720. /* OR 84 */ { ST_N06, 1, 168 },
  1721. /* OR 85 */ { ST_N07, 2, 169 },
  1722. /* OR 86 */ { ST_N08, 1, 171 },
  1723. /* OTDM 87 */ { ST_N01, 1, 172 },
  1724. /* OTDMR 88 */ { ST_N01, 1, 173 },
  1725. /* OTDR 89 */ { ST_N01, 1, 174 },
  1726. /* OTIM 90 */ { ST_N01, 1, 175 },
  1727. /* OTIMR 91 */ { ST_N01, 1, 176 },
  1728. /* OTIR 92 */ { ST_N01, 1, 177 },
  1729. /* OUT0 93 */ { ST_IO01, 1, 178 },
  1730. /* OUT 94 */ { ST_IO01, 1, 179 },
  1731. /* OUT 95 */ { ST_IO02, 1, 180 },
  1732. /* OUTD 96 */ { ST_N01, 1, 181 },
  1733. /* OUTI 97 */ { ST_N01, 1, 182 },
  1734. /* POP 98 */ { ST_N04, 6, 183 },
  1735. /* PUSH 99 */ { ST_N04, 6, 189 },
  1736. /* RES 100 */ { ST_B01, 1, 195 },
  1737. /* RES 101 */ { ST_B02, 2, 196 },
  1738. /* RES 102 */ { ST_B03, 1, 198 },
  1739. /* RET 103 */ { ST_CC04, 8, 199 },
  1740. /* RET 104 */ { ST_CC05, 1, 207 },
  1741. /* RETI 105 */ { ST_N01, 1, 208 },
  1742. /* RETN 106 */ { ST_N01, 1, 209 },
  1743. /* RIM 107 */ { ST_N01, 1, 210 },
  1744. /* RL 108 */ { ST_N02, 1, 211 },
  1745. /* RL 109 */ { ST_N07, 2, 212 },
  1746. /* RL 110 */ { ST_N08, 1, 214 },
  1747. /* RLA 111 */ { ST_N01, 1, 215 },
  1748. /* RLC 112 */ { ST_N02, 1, 216 },
  1749. /* RLC 113 */ { ST_N07, 2, 217 },
  1750. /* RLC 114 */ { ST_N08, 1, 219 },
  1751. /* RLCA 115 */ { ST_N01, 1, 220 },
  1752. /* RLD 116 */ { ST_N01, 1, 221 },
  1753. /* RR 117 */ { ST_N02, 1, 222 },
  1754. /* RR 118 */ { ST_N07, 2, 223 },
  1755. /* RR 119 */ { ST_N08, 1, 225 },
  1756. /* RRA 120 */ { ST_N01, 1, 226 },
  1757. /* RRC 121 */ { ST_N02, 1, 227 },
  1758. /* RRC 122 */ { ST_N07, 2, 228 },
  1759. /* RRC 123 */ { ST_N08, 1, 230 },
  1760. /* RRCA 124 */ { ST_N01, 1, 231 },
  1761. /* RRD 125 */ { ST_N01, 1, 232 },
  1762. /* RST 126 */ { ST_R01, 1, 233 },
  1763. /* SBC 127 */ { ST_N05, 4, 234 },
  1764. /* SBC 128 */ { ST_N09, 1, 238 },
  1765. /* SBC 129 */ { ST_N10, 1, 239 },
  1766. /* SBC 130 */ { ST_N11, 2, 240 },
  1767. /* SBC 131 */ { ST_N12, 1, 242 },
  1768. /* SCF 132 */ { ST_N01, 1, 243 },
  1769. /* SET 133 */ { ST_B01, 1, 244 },
  1770. /* SET 134 */ { ST_B02, 2, 245 },
  1771. /* SET 135 */ { ST_B03, 1, 247 },
  1772. /* SIM 136 */ { ST_N01, 1, 248 },
  1773. /* SLA 137 */ { ST_N02, 1, 249 },
  1774. /* SLA 138 */ { ST_N07, 2, 250 },
  1775. /* SLA 139 */ { ST_N08, 1, 252 },
  1776. /* SLP 140 */ { ST_N01, 1, 253 },
  1777. /* SRA 141 */ { ST_N02, 1, 254 },
  1778. /* SRA 142 */ { ST_N07, 2, 255 },
  1779. /* SRA 143 */ { ST_N08, 1, 257 },
  1780. /* SRL 144 */ { ST_N02, 1, 258 },
  1781. /* SRL 145 */ { ST_N07, 2, 259 },
  1782. /* SRL 146 */ { ST_N08, 1, 261 },
  1783. /* SUB 147 */ { ST_N02, 1, 262 },
  1784. /* SUB 148 */ { ST_N06, 1, 263 },
  1785. /* SUB 149 */ { ST_N07, 2, 264 },
  1786. /* SUB 150 */ { ST_N08, 1, 266 },
  1787. /* TST 151 */ { ST_N02, 1, 267 },
  1788. /* TST 152 */ { ST_N06, 1, 268 },
  1789. /* TST 153 */ { ST_N08, 1, 269 },
  1790. /* TSTIO 154 */ { ST_N06, 1, 270 },
  1791. /* XOR 155 */ { ST_N02, 1, 271 },
  1792. /* XOR 156 */ { ST_N06, 1, 272 },
  1793. /* XOR 157 */ { ST_N07, 2, 273 },
  1794. /* XOR 158 */ { ST_N08, 1, 275 },
  1795.     { 0, 0, 0 } };
  1796.  
  1797. struct igel igtab[NUMDIFFOP+1]
  1798.     = {
  1799. /* invalid 0 */   { 0 , 0, 
  1800.         "[Xnullentry" },
  1801. /* invalid 1 */   { 0 , 0, 
  1802.         "[Xinvalid opcode" },
  1803. /* ADC 2 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTHL|DRBC, 
  1804.         "ed;4a;" },
  1805. /* ADC 3 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTHL|DRDE, 
  1806.         "ed;5a;" },
  1807. /* ADC 4 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTHL|DRHL, 
  1808.         "ed;6a;" },
  1809. /* ADC 5 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTHL|DRSP, 
  1810.         "ed;7a;" },
  1811. /* ADC 6 */   { REGISA , REGISA, 
  1812.         "8e;" },
  1813. /* ADC 7 */   { REGISA , REGISA, 
  1814.         "ce;[1=];" },
  1815. /* ADC 8 */   { REGISA|TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX|REGISA, 
  1816.         "dd;8e;[1=]r" },
  1817. /* ADC 9 */   { REGISA|TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY|REGISA, 
  1818.         "fd;8e;[1=]r" },
  1819. /* ADC 10 */   { REGISA|0 , 0|REGISA, 
  1820.         "88.[1#]|;" },
  1821. /* ADD 11 */   { DRDESTMASK|DRMASK , DRDESTHL|DRBC, 
  1822.         "09;" },
  1823. /* ADD 12 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTIX|DRBC, 
  1824.         "dd;09;" },
  1825. /* ADD 13 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTIY|DRBC, 
  1826.         "fd;09;" },
  1827. /* ADD 14 */   { DRDESTMASK|DRMASK , DRDESTHL|DRDE, 
  1828.         "19;" },
  1829. /* ADD 15 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTIX|DRDE, 
  1830.         "dd;19;" },
  1831. /* ADD 16 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTIY|DRDE, 
  1832.         "fd;19;" },
  1833. /* ADD 17 */   { DRDESTMASK|DRMASK , DRDESTHL|DRHL, 
  1834.         "29;" },
  1835. /* ADD 18 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTIX|DRIX, 
  1836.         "dd;29;" },
  1837. /* ADD 19 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTIY|DRIY, 
  1838.         "fd;29;" },
  1839. /* ADD 20 */   { DRDESTMASK|DRMASK , DRDESTHL|DRSP, 
  1840.         "39;" },
  1841. /* ADD 21 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTIX|DRSP, 
  1842.         "dd;39;" },
  1843. /* ADD 22 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTIY|DRSP, 
  1844.         "fd;39;" },
  1845. /* ADD 23 */   { REGISA , REGISA, 
  1846.         "86;" },
  1847. /* ADD 24 */   { REGISA , REGISA, 
  1848.         "c6;[1=];" },
  1849. /* ADD 25 */   { REGISA|TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX|REGISA, 
  1850.         "dd;86;[1=]r" },
  1851. /* ADD 26 */   { REGISA|TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY|REGISA, 
  1852.         "fd;86;[1=]r" },
  1853. /* ADD 27 */   { REGISA|0 , 0|REGISA, 
  1854.         "80.[1#]|;" },
  1855. /* AND 28 */   { 0 , 0, 
  1856.         "a6;" },
  1857. /* AND 29 */   { 0 , 0, 
  1858.         "e6;[1=];" },
  1859. /* AND 30 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  1860.         "dd;a6;[1=]r" },
  1861. /* AND 31 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  1862.         "fd;a6;[1=]r" },
  1863. /* AND 32 */   { 0 , 0, 
  1864.         "a0.[1#]|;" },
  1865. /* BIT 33 */   { TSZ80PLUS , TSZ80PLUS, 
  1866.         "cb;[1#].46|;" },
  1867. /* BIT 34 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  1868.         "dd;cb;[2=]r46.[1#]|;" },
  1869. /* BIT 35 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  1870.         "fd;cb;[2=]r46.[1#]|;" },
  1871. /* BIT 36 */   { TSZ80PLUS , TSZ80PLUS, 
  1872.         "cb;[1#].40|;" },
  1873. /* CALL 37 */   { CCSELMASK , CCSELNZ, 
  1874.         "c4;[1=]y" },
  1875. /* CALL 38 */   { CCSELMASK , CCSELZ, 
  1876.         "cc;[1=]y" },
  1877. /* CALL 39 */   { CCSELMASK , CCSELNC, 
  1878.         "d4;[1=]y" },
  1879. /* CALL 40 */   { CCSELMASK , CCSELC, 
  1880.         "dc;[1=]y" },
  1881. /* CALL 41 */   { CCSELMASK , CCSELPO, 
  1882.         "e4;[1=]y" },
  1883. /* CALL 42 */   { CCSELMASK , CCSELPE, 
  1884.         "ec;[1=]y" },
  1885. /* CALL 43 */   { CCSELMASK , CCSELP, 
  1886.         "f4;[1=]y" },
  1887. /* CALL 44 */   { CCSELMASK , CCSELM, 
  1888.         "fc;[1=]y" },
  1889. /* CALL 45 */   { 0 , 0, 
  1890.         "cd;[1=]y" },
  1891. /* CCF 46 */   { 0 , 0, 
  1892.         "3f;" },
  1893. /* CP 47 */   { 0 , 0, 
  1894.         "be;" },
  1895. /* CP 48 */   { 0 , 0, 
  1896.         "fe;[1=];" },
  1897. /* CP 49 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  1898.         "dd;be;[1=]r" },
  1899. /* CP 50 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  1900.         "fd;be;[1=]r" },
  1901. /* CP 51 */   { 0 , 0, 
  1902.         "b8.[1#]|;" },
  1903. /* CPD 52 */   { TSZ80PLUS , TSZ80PLUS, 
  1904.         "ed;a9;"  },
  1905. /* CPDR 53 */   { TSZ80PLUS , TSZ80PLUS, 
  1906.         "ed;b9;"  },
  1907. /* CPI 54 */   { TSZ80PLUS , TSZ80PLUS, 
  1908.         "ed;a1;"  },
  1909. /* CPIR 55 */   { TSZ80PLUS , TSZ80PLUS, 
  1910.         "ed;b1;"  },
  1911. /* CPL 56 */   { 0 , 0, 
  1912.         "2f;" },
  1913. /* DAA 57 */   { 0 , 0, 
  1914.         "27;" },
  1915. /* DEC 58 */   { 0 , 0, 
  1916.         "35;" },
  1917. /* DEC 59 */   { DRMASK , DRBC, 
  1918.         "0b;" },
  1919. /* DEC 60 */   { DRMASK , DRDE, 
  1920.         "1b;" },
  1921. /* DEC 61 */   { DRMASK , DRHL, 
  1922.         "2b;" },
  1923. /* DEC 62 */   { DRMASK , DRSP, 
  1924.         "3b;" },
  1925. /* DEC 63 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  1926.         "dd;2b;" },
  1927. /* DEC 64 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  1928.         "fd;2b;" },
  1929. /* DEC 65 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  1930.         "dd;35;[1=]r" },
  1931. /* DEC 66 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  1932.         "fd;35;[1=]r" },
  1933. /* DEC 67 */   { 0 , 0, 
  1934.         "05.[2#]|;" },
  1935. /* DI 68 */   { 0 , 0, 
  1936.         "f3;" },
  1937. /* DJNZ 69 */   { 0 , 0, 
  1938.         "10;[1=].P.2+-r" },
  1939. /* EI 70 */   { 0 , 0, 
  1940.         "fb;" },
  1941. /* EX 71 */   { EXMASK , EX1DE|EX2HL, 
  1942.         "eb;" },
  1943. /* EX 72 */   { TSZ80PLUS|EXMASK , TSZ80PLUS|EX1AF|EX2AF, 
  1944.         "08;" },
  1945. /* EX 73 */   { DRMASK , DRHL, 
  1946.         "e3;" },
  1947. /* EX 74 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  1948.         "dd;e3;" },
  1949. /* EX 75 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  1950.         "fd;e3;" },
  1951. /* EXX 76 */   { TSZ80PLUS , TSZ80PLUS, 
  1952.         "d9;" },
  1953. /* HALT 77 */   { 0 , 0, 
  1954.         "76;" },
  1955. /* IM 78 */   { TSZ80PLUS|INTSETMASK , TSZ80PLUS|INTSETMODE0, 
  1956.         "ed;46;" },
  1957. /* IM 79 */   { TSZ80PLUS|INTSETMASK , TSZ80PLUS|INTSETMODE1, 
  1958.         "ed;56;" },
  1959. /* IM 80 */   { TSZ80PLUS|INTSETMASK , TSZ80PLUS|INTSETMODE2, 
  1960.         "ed;5e;" },
  1961. /* IN0 81 */   { TS64180 , TS64180, 
  1962.         "ed;00.[1#]|;[2=];" },
  1963. /* IN 82 */   { REGISA , REGISA, 
  1964.         "db;[2=];" },
  1965. /* IN 83 */   { TSZ80PLUS , TSZ80PLUS, 
  1966.         "ed;40.[1#]|;" },
  1967. /* INC 84 */   { 0 , 0, 
  1968.         "34;" },
  1969. /* INC 85 */   { DRMASK , DRBC, 
  1970.         "03;" },
  1971. /* INC 86 */   { DRMASK , DRDE, 
  1972.         "13;" },
  1973. /* INC 87 */   { DRMASK , DRHL, 
  1974.         "23;" },
  1975. /* INC 88 */   { DRMASK , DRSP, 
  1976.         "33;" },
  1977. /* INC 89 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  1978.         "dd;23;" },
  1979. /* INC 90 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  1980.         "fd;23;" },
  1981. /* INC 91 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  1982.         "dd;34;[1=]r" },
  1983. /* INC 92 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  1984.         "fd;34;[1=]r" },
  1985. /* INC 93 */   { 0 , 0, 
  1986.         "04.[2#]|;" },
  1987. /* IND 94 */   { TSZ80PLUS , TSZ80PLUS, 
  1988.         "ed;aa;" },
  1989. /* INDR 95 */   { TSZ80PLUS , TSZ80PLUS, 
  1990.         "ed;ba;" },
  1991. /* INI 96 */   { TSZ80PLUS , TSZ80PLUS, 
  1992.         "ed;a2;" },
  1993. /* INIR 97 */   { TSZ80PLUS , TSZ80PLUS, 
  1994.         "ed;b2;" },
  1995. /* JP 98 */   { DRMASK , DRHL, 
  1996.         "e9;" },
  1997. /* JP 99 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  1998.         "dd;e9;" },
  1999. /* JP 100 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  2000.         "fd;e9;" },
  2001. /* JP 101 */   { CCSELMASK , CCSELNZ, 
  2002.         "c2;[1=]y" },
  2003. /* JP 102 */   { CCSELMASK , CCSELZ, 
  2004.         "ca;[1=]y" },
  2005. /* JP 103 */   { CCSELMASK , CCSELNC, 
  2006.         "d2;[1=]y" },
  2007. /* JP 104 */   { CCSELMASK , CCSELC, 
  2008.         "da;[1=]y" },
  2009. /* JP 105 */   { CCSELMASK , CCSELPO, 
  2010.         "e2;[1=]y" },
  2011. /* JP 106 */   { CCSELMASK , CCSELPE, 
  2012.         "ea;[1=]y" },
  2013. /* JP 107 */   { CCSELMASK , CCSELP, 
  2014.         "f2;[1=]y" },
  2015. /* JP 108 */   { CCSELMASK , CCSELM, 
  2016.         "fa;[1=]y" },
  2017. /* JP 109 */   { 0 , 0, 
  2018.         "c3;[1=]y" },
  2019. /* JR 110 */   { TSZ80PLUS|CCSELMASK , CCSELNZ|TSZ80PLUS, 
  2020.         "20;[1=].P.2+-r" },
  2021. /* JR 111 */   { TSZ80PLUS|CCSELMASK , CCSELZ|TSZ80PLUS, 
  2022.         "28;[1=].P.2+-r" },
  2023. /* JR 112 */   { TSZ80PLUS|CCSELMASK , CCSELNC|TSZ80PLUS, 
  2024.         "30;[1=].P.2+-r" },
  2025. /* JR 113 */   { TSZ80PLUS|CCSELMASK , CCSELC|TSZ80PLUS, 
  2026.         "38;[1=].P.2+-r" },
  2027. /* JR 114 */   { TSZ80PLUS , TSZ80PLUS, 
  2028.         "18;[1=].P.2+-r" },
  2029. /* LD 115 */   { DRMASK , DRHL, 
  2030.         "36;[1=];" },
  2031. /* LD 116 */   { DRMASK , DRHL, 
  2032.         "70.[1#]|;" },
  2033. /* LD 117 */   { DRMASK|REGISA , DRBC|REGISA, 
  2034.         "02;" },
  2035. /* LD 118 */   { DRMASK|REGISA , DRDE|REGISA, 
  2036.         "12;" },
  2037. /* LD 119 */   { DRMASK , DRHL, 
  2038.         "22;[1=]y" },
  2039. /* LD 120 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  2040.         "dd;22;[1=]y" },
  2041. /* LD 121 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  2042.         "fd;22;[1=]y" },
  2043. /* LD 122 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRBC, 
  2044.         "ed;43;[1=]y" },
  2045. /* LD 123 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRDE, 
  2046.         "ed;53;[1=]y" },
  2047. /* LD 124 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRSP, 
  2048.         "ed;73;[1=]y" },
  2049. /* LD 125 */   { 0 , 0, 
  2050.         "32;[1=]y" },
  2051. /* LD 126 */   { DRMASK , DRHL, 
  2052.         "2a;[1=]y" },
  2053. /* LD 127 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  2054.         "dd;2a;[1=]y" },
  2055. /* LD 128 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  2056.         "fd;2a;[1=]y" },
  2057. /* LD 129 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRBC, 
  2058.         "ed;4b;[1=]y" },
  2059. /* LD 130 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRDE, 
  2060.         "ed;5b;[1=]y" },
  2061. /* LD 131 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRSP, 
  2062.         "ed;7b;[1=]y" },
  2063. /* LD 132 */   { DRDESTMASK|TSZ80PLUS|DRMASK , TSZ80PLUS|DRHL|DRDESTSP, 
  2064.         "f9;" },
  2065. /* LD 133 */   { DRDESTMASK|TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX|DRDESTSP, 
  2066.         "dd;f9;" },
  2067. /* LD 134 */   { DRDESTMASK|TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY|DRDESTSP, 
  2068.         "fd;f9;" },
  2069. /* LD 135 */   { DRMASK , DRHL, 
  2070.         "21;[1=]y" },
  2071. /* LD 136 */   { DRMASK , DRBC, 
  2072.         "01;[1=]y" },
  2073. /* LD 137 */   { DRMASK , DRDE, 
  2074.         "11;[1=]y" },
  2075. /* LD 138 */   { DRMASK , DRSP, 
  2076.         "31;[1=]y" },
  2077. /* LD 139 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  2078.         "dd;21;[1=]y" },
  2079. /* LD 140 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  2080.         "fd;21;[1=]y" },
  2081. /* LD 141 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  2082.         "dd;36;[1=]r[2=];" },
  2083. /* LD 142 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  2084.         "fd;36;[1=]r[2=];" },
  2085. /* LD 143 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  2086.         "dd;70.[2#]|;[1=]r" },
  2087. /* LD 144 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  2088.         "fd;70.[2#]|;[1=]r" },
  2089. /* LD 145 */   { DRMASK , DRHL, 
  2090.         "46.[1#]|;" },
  2091. /* LD 146 */   { DRMASK|REGISA , DRBC|REGISA, 
  2092.         "0a;" },
  2093. /* LD 147 */   { DRMASK|REGISA , DRDE|REGISA, 
  2094.         "1a;" },
  2095. /* LD 148 */   { 0 , 0, 
  2096.         "06.[1#]|;[2=];" },
  2097. /* LD 149 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  2098.         "dd;46.[1#]|;[2=]r" },
  2099. /* LD 150 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  2100.         "fd;46.[1#]|;[2=]r" },
  2101. /* LD 151 */   { 0 , 0, 
  2102.         "40.[1#]|;" },
  2103. /* LD 152 */   { REGISA , REGISA, 
  2104.         "3a;[1=]y" },
  2105. /* LD 153 */   { REGISA|TSZ80PLUS|SPECIALRMASK , TSZ80PLUS|SPECIALIR|REGISA, 
  2106.         "ed;57;" },
  2107. /* LD 154 */   { REGISA|TSZ80PLUS|SPECIALRMASK , TSZ80PLUS|SPECIALRR|REGISA, 
  2108.         "ed;5f;" },
  2109. /* LD 155 */   { TSZ80PLUS|SPECIALRMASK , TSZ80PLUS|SPECIALIR, 
  2110.         "ed;47;" },
  2111. /* LD 156 */   { TSZ80PLUS|SPECIALRMASK , TSZ80PLUS|SPECIALRR, 
  2112.         "ed;4f;" },
  2113. /* LDD 157 */   { TSZ80PLUS , TSZ80PLUS, 
  2114.         "ed;a8;" },
  2115. /* LDDR 158 */   { TSZ80PLUS , TSZ80PLUS, 
  2116.         "ed;b8;" },
  2117. /* LDI 159 */   { TSZ80PLUS , TSZ80PLUS, 
  2118.         "ed;a0;" },
  2119. /* LDIR 160 */   { TSZ80PLUS , TSZ80PLUS, 
  2120.         "ed;b0;" },
  2121. /* MULT 161 */   { TS64180|DRMASK , TS64180|DRBC, 
  2122.         "ed;4c;" },
  2123. /* MULT 162 */   { TS64180|DRMASK , TS64180|DRDE, 
  2124.         "ed;5c;" },
  2125. /* MULT 163 */   { TS64180|DRMASK , TS64180|DRHL, 
  2126.         "ed;6c;" },
  2127. /* MULT 164 */   { TS64180|DRMASK , TS64180|DRSP, 
  2128.         "ed;7c;" },
  2129. /* NEG 165 */   { TSZ80PLUS , TSZ80PLUS, 
  2130.         "ed;44;" },
  2131. /* NOP 166 */   { 0 , 0, 
  2132.         "00;" },
  2133. /* OR 167 */   { 0 , 0, 
  2134.         "b6;" },
  2135. /* OR 168 */   { 0 , 0, 
  2136.         "f6;[1=];" },
  2137. /* OR 169 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  2138.         "dd;b6;[1=]r" },
  2139. /* OR 170 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  2140.         "fd;b6;[1=]r" },
  2141. /* OR 171 */   { 0 , 0, 
  2142.         "b0.[1#]|;" },
  2143. /* OTDM 172 */   { TS64180 , TS64180, 
  2144.         "ed;8b;" },
  2145. /* OTDMR 173 */   { TS64180 , TS64180, 
  2146.         "ed;9b;" },
  2147. /* OTDR 174 */   { TSZ80PLUS , TSZ80PLUS, 
  2148.         "ed;bb;" },
  2149. /* OTIM 175 */   { TS64180 , TS64180, 
  2150.         "ed;83;" },
  2151. /* OTIMR 176 */   { TS64180 , TS64180, 
  2152.         "ed;93;" },
  2153. /* OTIR 177 */   { TSZ80PLUS , TSZ80PLUS, 
  2154.         "ed;b3;" },
  2155. /* OUT0 178 */   { TS64180 , TS64180, 
  2156.         "ed;01.[2#]|;[1=];" },
  2157. /* OUT 179 */   { REGISA , REGISA, 
  2158.         "d3;[1=];" },
  2159. /* OUT 180 */   { TSZ80PLUS , TSZ80PLUS, 
  2160.         "ed;41.[1#]|;" },
  2161. /* OUTD 181 */   { TSZ80PLUS , TSZ80PLUS, 
  2162.         "ed;ab;" },
  2163. /* OUTI 182 */   { TSZ80PLUS , TSZ80PLUS, 
  2164.         "ed;a3;" },
  2165. /* POP 183 */   { DRMASK , DRBC, 
  2166.         "c1;" },
  2167. /* POP 184 */   { DRMASK , DRDE, 
  2168.         "d1;" },
  2169. /* POP 185 */   { DRMASK , DRHL, 
  2170.         "e1;" },
  2171. /* POP 186 */   { DRMASK , DRAF, 
  2172.         "f1;" },
  2173. /* POP 187 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  2174.         "dd;e1;" },
  2175. /* POP 188 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  2176.         "fd;e1;" },
  2177. /* PUSH 189 */   { DRMASK , DRBC, 
  2178.         "c5;" },
  2179. /* PUSH 190 */   { DRMASK , DRDE, 
  2180.         "d5;" },
  2181. /* PUSH 191 */   { DRMASK , DRHL, 
  2182.         "e5;" },
  2183. /* PUSH 192 */   { DRMASK , DRAF, 
  2184.         "f5;" },
  2185. /* PUSH 193 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  2186.         "dd;e5;" },
  2187. /* PUSH 194 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  2188.         "fd;e5;" },
  2189. /* RES 195 */   { TSZ80PLUS , TSZ80PLUS, 
  2190.         "cb;[1#].86|;" },
  2191. /* RES 196 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  2192.         "dd;cb;[2=]r86.[1#]|;" },
  2193. /* RES 197 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  2194.         "fd;cb;[2=]r86.[1#]|;" },
  2195. /* RES 198 */   { TSZ80PLUS , TSZ80PLUS, 
  2196.         "cb;[1#].80|;" },
  2197. /* RET 199 */   { CCSELMASK , CCSELNZ, 
  2198.         "c0;" },
  2199. /* RET 200 */   { CCSELMASK , CCSELZ, 
  2200.         "c8;" },
  2201. /* RET 201 */   { CCSELMASK , CCSELNC, 
  2202.         "d0;" },
  2203. /* RET 202 */   { CCSELMASK , CCSELC, 
  2204.         "d8;" },
  2205. /* RET 203 */   { CCSELMASK , CCSELPO, 
  2206.         "e0;" },
  2207. /* RET 204 */   { CCSELMASK , CCSELPE, 
  2208.         "e8;" },
  2209. /* RET 205 */   { CCSELMASK , CCSELP, 
  2210.         "f0;" },
  2211. /* RET 206 */   { CCSELMASK , CCSELM, 
  2212.         "f8;" },
  2213. /* RET 207 */   { 0 , 0, 
  2214.         "c9;" },
  2215. /* RETI 208 */   { TSZ80PLUS , TSZ80PLUS, 
  2216.         "ed;4d;" },
  2217. /* RETN 209 */   { TSZ80PLUS , TSZ80PLUS, 
  2218.         "ed;45;" },
  2219. /* RIM 210 */   { CPUMASK , CPU8085, 
  2220.         "20;" },
  2221. /* RL 211 */   { TSZ80PLUS , TSZ80PLUS, 
  2222.         "cb;16;" },
  2223. /* RL 212 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  2224.         "dd;cb;[1=]r16;" },
  2225. /* RL 213 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  2226.         "fd;cb;[1=]r16;" },
  2227. /* RL 214 */   { TSZ80PLUS , TSZ80PLUS, 
  2228.         "cb;10.[1#]|;" },
  2229. /* RLA 215 */   { 0 , 0, 
  2230.         "17;" },
  2231. /* RLC 216 */   { TSZ80PLUS , TSZ80PLUS, 
  2232.         "cb;06;" },
  2233. /* RLC 217 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  2234.         "dd;cb;[1=]r06;" },
  2235. /* RLC 218 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  2236.         "fd;cb;[1=]r06;" },
  2237. /* RLC 219 */   { TSZ80PLUS , TSZ80PLUS, 
  2238.         "cb;00.[1#]|;" },
  2239. /* RLCA 220 */   { 0 , 0, 
  2240.         "07;" },
  2241. /* RLD 221 */   { TSZ80PLUS , TSZ80PLUS, 
  2242.         "ed;6f;" },
  2243. /* RR 222 */   { TSZ80PLUS , TSZ80PLUS, 
  2244.         "cb;1e;" },
  2245. /* RR 223 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  2246.         "dd;cb;[1=]r1e;" },
  2247. /* RR 224 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  2248.         "fd;cb;[1=]r1e;" },
  2249. /* RR 225 */   { TSZ80PLUS , TSZ80PLUS, 
  2250.         "cb;18.[1#]|;" },
  2251. /* RRA 226 */   { 0 , 0, 
  2252.         "1f;" },
  2253. /* RRC 227 */   { TSZ80PLUS , TSZ80PLUS, 
  2254.         "cb;0e;" },
  2255. /* RRC 228 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  2256.         "dd;cb;[1=]r0e;" },
  2257. /* RRC 229 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  2258.         "fd;cb;[1=]r0e;" },
  2259. /* RRC 230 */   { TSZ80PLUS , TSZ80PLUS, 
  2260.         "cb;08.[1#]|;" },
  2261. /* RRCA 231 */   { 0 , 0, 
  2262.         "0f;" },
  2263. /* RRD 232 */   { TSZ80PLUS , TSZ80PLUS, 
  2264.         "ed;67;" },
  2265. /* RST 233 */   { 0 , 0, 
  2266.         "c7.[1#]|;" },
  2267. /* SBC 234 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTHL|DRBC, 
  2268.         "ed;42;" },
  2269. /* SBC 235 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTHL|DRDE, 
  2270.         "ed;52;" },
  2271. /* SBC 236 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTHL|DRHL, 
  2272.         "ed;62;" },
  2273. /* SBC 237 */   { TSZ80PLUS|DRDESTMASK|DRMASK , TSZ80PLUS|DRDESTHL|DRSP, 
  2274.         "ed;72;" },
  2275. /* SBC 238 */   { REGISA , REGISA, 
  2276.         "9e;" },
  2277. /* SBC 239 */   { REGISA , REGISA, 
  2278.         "de;[1=];" },
  2279. /* SBC 240 */   { REGISA|TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX|REGISA, 
  2280.         "dd;9e;[1=]r" },
  2281. /* SBC 241 */   { REGISA|TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY|REGISA, 
  2282.         "fd;9e;[1=]r" },
  2283. /* SBC 242 */   { REGISA|0 , 0|REGISA, 
  2284.         "98.[1#]|;" },
  2285. /* SCF 243 */   { 0 , 0, 
  2286.         "37;" },
  2287. /* SET 244 */   { TSZ80PLUS , TSZ80PLUS, 
  2288.         "cb;[1#].c6|;" },
  2289. /* SET 245 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIX, 
  2290.         "dd;cb;[2=]rc6.[1#]|;" },
  2291. /* SET 246 */   { TSZ80PLUS|DRMASK , TSZ80PLUS|DRIY, 
  2292.         "fd;cb;[2=]rc6.[1#]|;" },
  2293. /* SET 247 */   { TSZ80PLUS , TSZ80PLUS, 
  2294.         "cb;[1#].c0|;" },
  2295. /* SIM 248 */   { CPUMASK , CPU8085, 
  2296.         "30;" },
  2297. /* SLA 249 */   { TSZ80PLUS , TSZ80PLUS, 
  2298.         "cb;26;" },
  2299. /* SLA 250 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  2300.         "dd;cb;[1=]r26;" },
  2301. /* SLA 251 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  2302.         "fd;cb;[1=]r26;" },
  2303. /* SLA 252 */   { TSZ80PLUS , TSZ80PLUS, 
  2304.         "cb;20.[1#]|;" },
  2305. /* SLP 253 */   { TS64180 , TS64180, 
  2306.         "ed;76;" },
  2307. /* SRA 254 */   { TSZ80PLUS , TSZ80PLUS, 
  2308.         "cb;2e;" },
  2309. /* SRA 255 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  2310.         "dd;cb;[1=]r2e;" },
  2311. /* SRA 256 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  2312.         "fd;cb;[1=]r2e;" },
  2313. /* SRA 257 */   { TSZ80PLUS , TSZ80PLUS, 
  2314.         "cb;28.[1#]|;" },
  2315. /* SRL 258 */   { TSZ80PLUS , TSZ80PLUS, 
  2316.         "cb;3e;" },
  2317. /* SRL 259 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  2318.         "dd;cb;[1=]r3e;" },
  2319. /* SRL 260 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  2320.         "fd;cb;[1=]r3e;" },
  2321. /* SRL 261 */   { TSZ80PLUS , TSZ80PLUS, 
  2322.         "cb;38.[1#]|;" },
  2323. /* SUB 262 */   { 0 , 0, 
  2324.         "96;" },
  2325. /* SUB 263 */   { 0 , 0, 
  2326.         "d6;[1=];" },
  2327. /* SUB 264 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  2328.         "dd;96;[1=]r" },
  2329. /* SUB 265 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  2330.         "fd;96;[1=]r" },
  2331. /* SUB 266 */   { 0 , 0, 
  2332.         "90.[1#]|;" },
  2333. /* TST 267 */   { TS64180 , TS64180, 
  2334.         "ed;34;" },
  2335. /* TST 268 */   { TS64180 , TS64180, 
  2336.         "ed;64;[1=];" },
  2337. /* TST 269 */   { TS64180 , TS64180, 
  2338.         "ed;04.[2#]|;" },
  2339. /* TSTIO 270 */   { TS64180 , TS64180, 
  2340.         "ed;74;[1=];" },
  2341. /* XOR 271 */   { 0 , 0, 
  2342.         "ae;" },
  2343. /* XOR 272 */   { 0 , 0, 
  2344.         "ee;[1=];" },
  2345. /* XOR 273 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIX, 
  2346.         "dd;ae;[1=]r" },
  2347. /* XOR 274 */   { DRMASK|TSZ80PLUS , TSZ80PLUS|DRIY, 
  2348.         "fd;ae;[1=]r" },
  2349. /* XOR 275 */   { 0 , 0, 
  2350.         "a8.[1#]|;" },
  2351.     { 0,0,""} };
  2352. /* end fraptabdef.c */
  2353.